Fix coding standards

This commit is contained in:
Romain Neutron
2012-01-26 12:32:37 +01:00
parent 692bb01b75
commit 06b8df26b1
312 changed files with 2017 additions and 1651 deletions

View File

@@ -9,18 +9,18 @@ environment : prod
################# #################
# DEVELOPPEMENT # # DEVELOPPEMENT #
################# #################
dev: dev:
#Phraseanet refers to phraseanet app specific configuration #Phraseanet refers to phraseanet app specific configuration
phraseanet: phraseanet:
servername: 'http://sub.domain.tld/' servername: 'http://sub.domain.tld/'
maintenance: false maintenance: false
debug: true debug: true
display_errors: true display_errors: true
#Assign your phraseanet application connection #Assign your phraseanet application connection
#Connections are defined in connexions.yml configuration file #Connections are defined in connexions.yml configuration file
database: main_connexion database: main_connexion
#Assign your template engine service & ORM service #Assign your template engine service & ORM service
#Services are defined in service.yml configuration file #Services are defined in service.yml configuration file
template_engine: twig_debug template_engine: twig_debug
@@ -36,10 +36,10 @@ prod:
debug: false debug: false
display_errors: false display_errors: false
database: main_connexion database: main_connexion
template_engine: twig template_engine: twig
orm: doctrine_prod orm: doctrine_prod
############## ##############
# TEST # # TEST #
############## ##############
@@ -50,8 +50,7 @@ test:
debug: true debug: true
display_errors: true display_errors: true
database: main_connexion database: main_connexion
template_engine: twig_debug template_engine: twig_debug
orm: doctrine_test orm: doctrine_test

View File

@@ -11,12 +11,12 @@ twig:
debug: false debug: false
#The charset used by the templates #The charset used by the templates
charset: utf-8 charset: utf-8
#Twig will silently ignore invalid variables (variables and or attributes/methods that do not exist) #Twig will silently ignore invalid variables (variables and or attributes/methods that do not exist)
#And replace them with a null value. When set to true, Twig throws an exception instead (default to false) #And replace them with a null value. When set to true, Twig throws an exception instead (default to false)
strict_variables: true strict_variables: true
#Optimize the node tree before compilation #Optimize the node tree before compilation
optimizer: true optimizer: true
twig_debug: twig_debug:
type: twig type: twig
options: options:
@@ -25,7 +25,7 @@ twig_debug:
strict_variables: true strict_variables: true
autoescape: true autoescape: true
optimizer: true optimizer: true
#Doctrine developement service options #Doctrine developement service options
#Service name #Service name
doctrine_dev: doctrine_dev:
@@ -47,15 +47,15 @@ doctrine_dev:
query: array_cache query: array_cache
result: array_cache result: array_cache
metadata: array_cache metadata: array_cache
# Assign a service to log doctrine queries # Assign a service to log doctrine queries
log: query_logger log: query_logger
# Doctrine test service options # Doctrine test service options
doctrine_test: doctrine_test:
type: doctrine type: doctrine
options: options:
debug: true debug: true
#Doctrine use a different connection configuration base to run tests #Doctrine use a different connection configuration base to run tests
dbal: test_connexion dbal: test_connexion
orm: orm:
cache: cache:
@@ -63,7 +63,7 @@ doctrine_test:
result: array_cache result: array_cache
metadata: array_cache metadata: array_cache
log: query_logger log: query_logger
# Doctrine production service options # Doctrine production service options
doctrine_prod: doctrine_prod:
type: doctrine type: doctrine
@@ -76,15 +76,15 @@ doctrine_prod:
result: apc_cache result: apc_cache
metadata: apc_cache metadata: apc_cache
log: query_logger log: query_logger
# Define a Log service # Define a Log service
# This one is defined to handle the logs of doctrine queries # This one is defined to handle the logs of doctrine queries
# Only Monolog is available as a logger service # Only Monolog is available as a logger service
# Please Notice that for doctrine ONLY a echo logger service is available, see below # Please Notice that for doctrine ONLY a echo logger service is available, see below
# Monolog logger use the PHP Monolog library to handle logs using differents handlers # Monolog logger use the PHP Monolog library to handle logs using differents handlers
query_logger: query_logger:
type: monolog type: monolog
options: options:
#You can precise the output format #You can precise the output format
#This option is only available when log are used to log doctrine queries #This option is only available when log are used to log doctrine queries
@@ -97,34 +97,34 @@ query_logger:
channel: query-logger channel: query-logger
#Define how the logs will be handled #Define how the logs will be handled
#Avalaibale Handler are [rotate, stream] #Avalaibale Handler are [rotate, stream]
#Rotate handler is used to stores logs to files that are rotated every day #Rotate handler is used to stores logs to files that are rotated every day
#And a limited number of files are kept by defining the max_day value #And a limited number of files are kept by defining the max_day value
#Stream handler is used to stores logs in a single local file #Stream handler is used to stores logs in a single local file
handler: rotate handler: rotate
max_day: 2 max_day: 2
#Name of the file where logs are written #Name of the file where logs are written
filename: doctrine-query.log filename: doctrine-query.log
# Define a phpecho log service for Doctrine # Define a phpecho log service for Doctrine
# phpecho logger logs doctrine queries to the standard output using echo/var_dump # phpecho logger logs doctrine queries to the standard output using echo/var_dump
# Notice that phpecho logger do not have options # Notice that phpecho logger do not have options
sql_logger: sql_logger:
type: phpecho type: phpecho
#Define cache services #Define cache services
#There are Four deffirent cache type available [array, xcache, apc, memcache] #There are Four deffirent cache type available [array, xcache, apc, memcache]
#Only a memcache service can take option to define port & host for the memcache server #Only a memcache service can take option to define port & host for the memcache server
array_cache: array_cache:
type: array type: array
memcache_cache: memcache_cache:
type: memcache type: memcache
options: options:
host: localhost host: localhost
port: 11211 port: 11211
apc_cache: apc_cache:
type: apc type: apc
xcache_cache: xcache_cache:
type: xcache type: xcache

View File

@@ -44,4 +44,4 @@ return call_user_func(
}); });
return $app; return $app;
}); });

View File

@@ -44,7 +44,7 @@ return call_user_func(function()
$app['p4user'] = null; $app['p4user'] = null;
/** /**
* @var API_OAuth2_Token * @var API_OAuth2_Token
*/ */
$app['token'] = null; $app['token'] = null;
@@ -123,6 +123,7 @@ return call_user_func(function()
} }
} }
} }
return array('ressource' => $ressource, 'general' => $general, 'aspect' => $aspect, 'action' => $action); return array('ressource' => $ressource, 'general' => $general, 'aspect' => $aspect, 'action' => $action);
}; };
@@ -141,6 +142,7 @@ return call_user_func(function()
$app['token'] = \API_OAuth2_Token::load_by_oauth_token($app["appbox"], $oauth2_adapter->getToken()); $app['token'] = \API_OAuth2_Token::load_by_oauth_token($app["appbox"], $oauth2_adapter->getToken());
if ($session->is_authenticated()) if ($session->is_authenticated())
return; return;
if ($oauth2_adapter->has_ses_id()) if ($oauth2_adapter->has_ses_id())
{ {
@@ -152,7 +154,7 @@ return call_user_func(function()
} }
catch (\Exception $e) catch (\Exception $e)
{ {
} }
} }
$auth = new \Session_Authentication_None($app['p4user']); $auth = new \Session_Authentication_None($app['p4user']);
@@ -738,4 +740,4 @@ return call_user_func(function()
//// */ //// */
//// public function add_user(\Symfony\Component\HttpFoundation\Request $app['request']); //// public function add_user(\Symfony\Component\HttpFoundation\Request $app['request']);
return $app; return $app;
}); });

View File

@@ -77,6 +77,7 @@ return call_user_func(
$browser = \Browser::getInstance(); $browser = \Browser::getInstance();
if (!$browser->isMobile()) if (!$browser->isMobile())
return new Response(''); return new Response('');
@@ -506,7 +507,7 @@ return call_user_func(
, 200 , 200
, array('Content-Type' => 'application/json') , array('Content-Type' => 'application/json')
); );
$response->setCharset('UTF-8'); $response->setCharset('UTF-8');
return $response; return $response;

View File

@@ -339,9 +339,9 @@ return call_user_func(function()
} }
catch (Exception $e) catch (Exception $e)
{ {
} }
$Serializer = $app['Core']['Serializer']; $Serializer = $app['Core']['Serializer'];
return new Response( return new Response(
@@ -374,9 +374,9 @@ return call_user_func(function()
} }
catch (Exception $e) catch (Exception $e)
{ {
} }
$Serializer = $app['Core']['Serializer']; $Serializer = $app['Core']['Serializer'];
return new Response( return new Response(
@@ -400,9 +400,9 @@ return call_user_func(function()
} }
catch (Exception $e) catch (Exception $e)
{ {
} }
$Serializer = $app['Core']['Serializer']; $Serializer = $app['Core']['Serializer'];
return new Response( return new Response(
@@ -424,9 +424,9 @@ return call_user_func(function()
} }
catch (\Exception $e) catch (\Exception $e)
{ {
} }
$Serializer = $app['Core']['Serializer']; $Serializer = $app['Core']['Serializer'];
return new Response( return new Response(
@@ -455,4 +455,4 @@ return call_user_func(function()
return $app; return $app;
}); });

View File

@@ -71,7 +71,7 @@ return call_user_func(
} }
catch (\Exception $e) catch (\Exception $e)
{ {
} }
return \set_export::stream_file($pathOut, $file->get_file(), $file->get_mime(), 'attachment'); return \set_export::stream_file($pathOut, $file->get_file(), $file->get_mime(), 'attachment');

View File

@@ -97,6 +97,7 @@ return call_user_func(function()
return new response($twig->render('/prod/actions/Bridge/deactivated.twig', $params), 200); return new response($twig->render('/prod/actions/Bridge/deactivated.twig', $params), 200);
} }
return new response($twig->render('/prod/actions/Bridge/error.twig', $params), 200); return new response($twig->render('/prod/actions/Bridge/error.twig', $params), 200);
} }
if ($request->getRequestFormat() == 'json') if ($request->getRequestFormat() == 'json')
@@ -114,4 +115,4 @@ return call_user_func(function()
return $app; return $app;
}); });

View File

@@ -36,10 +36,13 @@ return call_user_func(function()
{ {
$browser = \Browser::getInstance(); $browser = \Browser::getInstance();
if ($browser->isMobile()) if ($browser->isMobile())
return $app->redirect("/login/?redirect=/lightbox"); return $app->redirect("/login/?redirect=/lightbox");
elseif ($browser->isNewGeneration()) elseif ($browser->isNewGeneration())
return $app->redirect("/login/?redirect=/prod"); return $app->redirect("/login/?redirect=/prod");
else else
return $app->redirect("/login/?redirect=/client"); return $app->redirect("/login/?redirect=/client");
}); });
@@ -71,4 +74,4 @@ return call_user_func(function()
return $app; return $app;
} }
); );

View File

@@ -183,8 +183,10 @@ return call_user_func(function()
$app->get('/', function() use ($app) $app->get('/', function() use ($app)
{ {
if ($app['install'] === true) if ($app['install'] === true)
return $app->redirect('/setup/installer/'); return $app->redirect('/setup/installer/');
if ($app['upgrade'] === true) if ($app['upgrade'] === true)
return $app->redirect('/setup/upgrader/'); return $app->redirect('/setup/upgrader/');
}); });
@@ -197,6 +199,7 @@ return call_user_func(function()
$app->error(function($e) use ($app) $app->error(function($e) use ($app)
{ {
if ($e instanceof Exception_Setup_PhraseaAlreadyInstalled) if ($e instanceof Exception_Setup_PhraseaAlreadyInstalled)
return $app->redirect('/login'); return $app->redirect('/login');
return new Response( return new Response(
@@ -211,4 +214,4 @@ return call_user_func(function()
}); });
return $app; return $app;
}); });

View File

@@ -88,7 +88,7 @@ class Description implements ControllerProviderInterface
} }
catch (\Exception $e) catch (\Exception $e)
{ {
} }
$dces_element = null; $dces_element = null;
@@ -136,7 +136,7 @@ class Description implements ControllerProviderInterface
} }
catch (\Exception $e) catch (\Exception $e)
{ {
} }
} }
} }
@@ -183,7 +183,8 @@ class Description implements ControllerProviderInterface
return new Response($Core->getTwig()->render('admin/databox/doc_structure.twig', $params)); return new Response($Core->getTwig()->render('admin/databox/doc_structure.twig', $params));
}); });
return $controllers; return $controllers;
} }
} }

View File

@@ -37,7 +37,7 @@ class Fields implements ControllerProviderInterface
$controllers->get('/checkmulti/', function() use ($app, $appbox) $controllers->get('/checkmulti/', function() use ($app, $appbox)
{ {
$request = $app['request']; $request = $app['request'];
$multi = ($request->get('multi') === 'true'); $multi = ($request->get('multi') === 'true');
$metadata = \databox_field::load_class_from_xpath($request->get('source')); $metadata = \databox_field::load_class_from_xpath($request->get('source'));

View File

@@ -88,6 +88,7 @@ class Publications implements ControllerProviderInterface
$user = \User_Adapter::getInstance($appbox->get_session()->get_usr_id(), $appbox); $user = \User_Adapter::getInstance($appbox->get_session()->get_usr_id(), $appbox);
if (!$feed->is_owner($user)) if (!$feed->is_owner($user))
return $app->redirect('/admin/publications/feed/' . $id . '/?error=' . _('You are not the owner of this feed, you can not edit it')); return $app->redirect('/admin/publications/feed/' . $id . '/?error=' . _('You are not the owner of this feed, you can not edit it'));
$request = $app['request']; $request = $app['request'];
@@ -116,6 +117,7 @@ class Publications implements ControllerProviderInterface
$user = \User_Adapter::getInstance($appbox->get_session()->get_usr_id(), $appbox); $user = \User_Adapter::getInstance($appbox->get_session()->get_usr_id(), $appbox);
if (!$feed->is_owner($user)) if (!$feed->is_owner($user))
return new Response('ERROR:you are not allowed'); return new Response('ERROR:you are not allowed');
$request = $app["request"]; $request = $app["request"];
@@ -123,20 +125,25 @@ class Publications implements ControllerProviderInterface
$fileData = $request->files->get("Filedata"); $fileData = $request->files->get("Filedata");
if ($fileData['error'] !== 0) if ($fileData['error'] !== 0)
return new Response('ERROR:error while upload'); return new Response('ERROR:error while upload');
$file = new \system_file($fileData['tmp_name']); $file = new \system_file($fileData['tmp_name']);
if (!in_array($file->get_mime(), array('image/jpeg', 'image/jpg', 'image/gif'))) if (!in_array($file->get_mime(), array('image/jpeg', 'image/jpg', 'image/gif')))
return new Response('ERROR:bad filetype'); return new Response('ERROR:bad filetype');
if ($file->getSize() > 200000) if ($file->getSize() > 200000)
return new Response('ERROR:file too large'); return new Response('ERROR:file too large');
$datas = $file->get_technical_datas(); $datas = $file->get_technical_datas();
if (!isset($datas[\system_file::TC_DATAS_WIDTH]) || !isset($datas[\system_file::TC_DATAS_HEIGHT])) if (!isset($datas[\system_file::TC_DATAS_WIDTH]) || !isset($datas[\system_file::TC_DATAS_HEIGHT]))
return new Response('ERROR:file is not square'); return new Response('ERROR:file is not square');
if ($datas[\system_file::TC_DATAS_WIDTH] != $datas[\system_file::TC_DATAS_HEIGHT]) if ($datas[\system_file::TC_DATAS_WIDTH] != $datas[\system_file::TC_DATAS_HEIGHT])
return new Response('ERROR:file is not square'); return new Response('ERROR:file is not square');
$feed->set_icon($file); $feed->set_icon($file);

View File

@@ -44,7 +44,7 @@ class Root implements ControllerProviderInterface
$Core = $app['Core']; $Core = $app['Core'];
$appbox = \appbox::get_instance(); $appbox = \appbox::get_instance();
$user = $Core->getAuthenticatedUser(); $user = $Core->getAuthenticatedUser();
\User_Adapter::updateClientInfos(3); \User_Adapter::updateClientInfos(3);
$section = $app['request']->get('section', false); $section = $app['request']->get('section', false);
@@ -106,6 +106,7 @@ class Root implements ControllerProviderInterface
)) ))
); );
}); });
return $controllers; return $controllers;
} }

View File

@@ -126,11 +126,12 @@ class Subdefs implements ControllerProviderInterface
} }
} }
$subdefs->set_subdef($group, $name, $class, $downloadable, $options); $subdefs->set_subdef($group, $name, $class, $downloadable, $options);
} }
} }
return \phrasea::redirect('/admin/subdefs/' . $databox->get_sbas_id() . '/'); return \phrasea::redirect('/admin/subdefs/' . $databox->get_sbas_id() . '/');
}); });
return $controllers; return $controllers;
} }
} }

View File

@@ -10,12 +10,12 @@
*/ */
namespace Alchemy\Phrasea\Controller; namespace Alchemy\Phrasea\Controller;
/** /**
* *
* @package * @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class Exception extends \Exception class Exception extends \Exception
{ {
} }

View File

@@ -37,13 +37,13 @@ class Basket implements ControllerProviderInterface
/** /**
* This route is used to create a Basket * This route is used to create a Basket
* *
* @params name : title (mandatory) * @params name : title (mandatory)
* @params desc : description (optionnal) * @params desc : description (optionnal)
* @params lst : Phraseanet serialized record list (optionnal) * @params lst : Phraseanet serialized record list (optionnal)
* *
* @accept JSON / YAML * @accept JSON / YAML
* *
*/ */
$controllers->post('/', function(Application $app) $controllers->post('/', function(Application $app)
{ {
@@ -119,9 +119,9 @@ class Basket implements ControllerProviderInterface
/** /**
* This route is used to delete a basket * This route is used to delete a basket
* *
* @accept JSON / HTML * @accept JSON / HTML
* *
*/ */
$controllers->post('/{basket_id}/delete/', function(Application $app, Request $request, $basket_id) $controllers->post('/{basket_id}/delete/', function(Application $app, Request $request, $basket_id)
{ {
@@ -152,7 +152,7 @@ class Basket implements ControllerProviderInterface
}); });
/** /**
* Removes a BasketElement * Removes a BasketElement
*/ */
$controllers->post( $controllers->post(
'/{basket_id}/delete/{basket_element_id}/' '/{basket_id}/delete/{basket_element_id}/'
@@ -194,10 +194,10 @@ class Basket implements ControllerProviderInterface
/** /**
* Update name and description of a basket * Update name and description of a basket
* *
* @param name string mandatory * @param name string mandatory
* @param description string optionnal * @param description string optionnal
* *
*/ */
$controllers->post('/{basket_id}/update/', function(Application $app, Request $request, $basket_id) $controllers->post('/{basket_id}/update/', function(Application $app, Request $request, $basket_id)
{ {
@@ -255,7 +255,7 @@ class Basket implements ControllerProviderInterface
/** /**
* Get the Basket reorder form * Get the Basket reorder form
*/ */
$controllers->get( $controllers->get(
'/{basket_id}/reorder/' '/{basket_id}/reorder/'
@@ -280,10 +280,10 @@ class Basket implements ControllerProviderInterface
/** /**
* Toggle the status of a Basket * Toggle the status of a Basket
* *
* @param acrhive : 0|1 (mandatory) * @param acrhive : 0|1 (mandatory)
* *
* @returns JSON / HTML * @returns JSON / HTML
*/ */
$controllers->post('/{basket_id}/archive/', function(Application $app, Request $request, $basket_id) $controllers->post('/{basket_id}/archive/', function(Application $app, Request $request, $basket_id)
{ {
@@ -307,7 +307,7 @@ class Basket implements ControllerProviderInterface
{ {
$message = _('Basket has been unarchived'); $message = _('Basket has been unarchived');
} }
$data = array( $data = array(
'success' => true 'success' => true
, 'archive' => $archive_status , 'archive' => $archive_status
@@ -399,11 +399,11 @@ class Basket implements ControllerProviderInterface
/** /**
* *
* Move Basket element from a basket to another * Move Basket element from a basket to another
* *
* @params elements Array : list of basket element id * @params elements Array : list of basket element id
* *
*/ */
$controllers->post( $controllers->post(
'/{basket_id}/stealElements/' '/{basket_id}/stealElements/'
@@ -459,7 +459,7 @@ class Basket implements ControllerProviderInterface
}); });
/** /**
* Get basket creation form * Get basket creation form
*/ */
$controllers->get('/create/', function(Application $app) $controllers->get('/create/', function(Application $app)
{ {
@@ -470,7 +470,7 @@ class Basket implements ControllerProviderInterface
}); });
/** /**
* Get a basket * Get a basket
*/ */
$controllers->get('/{basket_id}/', function(Application $app, $basket_id) $controllers->get('/{basket_id}/', function(Application $app, $basket_id)
{ {

View File

@@ -49,11 +49,11 @@ class Edit implements ControllerProviderInterface
$controllers->get('/vocabulary/{vocabulary}/', function(Application $app, Request $request, $vocabulary) $controllers->get('/vocabulary/{vocabulary}/', function(Application $app, Request $request, $vocabulary)
{ {
$datas = array('success'=>false, 'message'=>'', 'results'=>array()); $datas = array('success'=>false, 'message'=>'', 'results'=>array());
$Serializer = $app['Core']['Serializer']; $Serializer = $app['Core']['Serializer'];
$sbas_id = (int) $request->get('sbas_id'); $sbas_id = (int) $request->get('sbas_id');
try try
{ {
$VC = \Alchemy\Phrasea\Vocabulary\Controller::get($vocabulary); $VC = \Alchemy\Phrasea\Vocabulary\Controller::get($vocabulary);
@@ -62,17 +62,17 @@ class Edit implements ControllerProviderInterface
catch(\Exception $e) catch(\Exception $e)
{ {
$datas['message'] = _('Vocabulary not found'); $datas['message'] = _('Vocabulary not found');
$datas = $Serializer->serialize($datas, 'json'); $datas = $Serializer->serialize($datas, 'json');
return new response($datas, 200, array('Content-Type'=>'application/json')); return new response($datas, 200, array('Content-Type'=>'application/json'));
} }
$query = $request->get('query'); $query = $request->get('query');
$datas['success'] = true; $datas['success'] = true;
$datas['results'] = $VC->find($query, $app['Core']->getAuthenticatedUser(), $databox); $datas['results'] = $VC->find($query, $app['Core']->getAuthenticatedUser(), $databox);
return new response($Serializer->serialize($datas, 'json'), 200, array('Content-Type'=>'application/json')); return new response($Serializer->serialize($datas, 'json'), 200, array('Content-Type'=>'application/json'));
} }
); );

View File

@@ -62,4 +62,4 @@ class MoveCollection implements ControllerProviderInterface
return $controllers; return $controllers;
} }
} }

View File

@@ -62,6 +62,7 @@ class Printer implements ControllerProviderInterface
->log($record, \Session_Logger::EVENT_PRINT, $layout, ''); ->log($record, \Session_Logger::EVENT_PRINT, $layout, '');
} }
$PDF = new PDFExport($printer->get_elements(), $layout); $PDF = new PDFExport($printer->get_elements(), $layout);
return new Response($PDF->render(), 200, array('Content-Type' => 'application/pdf')); return new Response($PDF->render(), 200, array('Content-Type' => 'application/pdf'));
} }
); );

View File

@@ -249,7 +249,7 @@ class Push implements ControllerProviderInterface
} }
catch (\Exception_NotFound $e) catch (\Exception_NotFound $e)
{ {
} }
$Participant = new \Entities\ValidationParticipant(); $Participant = new \Entities\ValidationParticipant();
@@ -335,7 +335,7 @@ class Push implements ControllerProviderInterface
->like(\User_Query::LIKE_LASTNAME, $request->get('query')) ->like(\User_Query::LIKE_LASTNAME, $request->get('query'))
->like(\User_Query::LIKE_LOGIN, $request->get('query')) ->like(\User_Query::LIKE_LOGIN, $request->get('query'))
->like_match(\User_Query::LIKE_MATCH_OR); ->like_match(\User_Query::LIKE_MATCH_OR);
$result = $query->include_phantoms() $result = $query->include_phantoms()
->limit(0, 50) ->limit(0, 50)
->execute()->get_results(); ->execute()->get_results();

View File

@@ -103,7 +103,7 @@ class Root implements ControllerProviderInterface
/* @var $twig \Twig_Environment */ /* @var $twig \Twig_Environment */
$twig = $app['Core']->getTwig(); $twig = $app['Core']->getTwig();
$Serializer = $app['Core']['Serializer']; $Serializer = $app['Core']['Serializer'];
$out = $twig->render('prod/index.html.twig', array( $out = $twig->render('prod/index.html.twig', array(

View File

@@ -105,7 +105,7 @@ class Story implements ControllerProviderInterface
'record_id' => $Story->get_record_id(), 'record_id' => $Story->get_record_id(),
) )
); );
$datas = $app['Core']['Serializer']->serialize($data, 'json'); $datas = $app['Core']['Serializer']->serialize($data, 'json');
return new Response($datas, 200, array('Content-type' => 'application/json')); return new Response($datas, 200, array('Content-type' => 'application/json'));

View File

@@ -102,13 +102,13 @@ class Tooltip implements ControllerProviderInterface
$record = new \record_adapter($sbas_id, $record_id, $number); $record = new \record_adapter($sbas_id, $record_id, $number);
$search_engine = null; $search_engine = null;
if (($search_engine_options = unserialize($app['request']->get('options_serial'))) !== false) if (($search_engine_options = unserialize($app['request']->get('options_serial'))) !== false)
{ {
$search_engine = new \searchEngine_adapter($app['appbox']->get_registry()); $search_engine = new \searchEngine_adapter($app['appbox']->get_registry());
$search_engine->set_options($search_engine_options); $search_engine->set_options($search_engine_options);
} }
/* @var $twig \Twig_Environment */ /* @var $twig \Twig_Environment */
$twig = $app['Core']->getTwig(); $twig = $app['Core']->getTwig();
@@ -200,4 +200,4 @@ class Tooltip implements ControllerProviderInterface
return $controllers; return $controllers;
} }
} }

View File

@@ -98,9 +98,9 @@ class UsrLists implements ControllerProviderInterface
$controllers->post('/list/', function(Application $app) $controllers->post('/list/', function(Application $app)
{ {
$request = $app['request']; $request = $app['request'];
$list_name = $request->get('name'); $list_name = $request->get('name');
$datas = array( $datas = array(
'success' => false 'success' => false
, 'message' => sprintf(_('Unable to create list %s'), $list_name) , 'message' => sprintf(_('Unable to create list %s'), $list_name)
@@ -112,7 +112,7 @@ class UsrLists implements ControllerProviderInterface
{ {
throw new ControllerException(_('List name is required')); throw new ControllerException(_('List name is required'));
} }
$em = $app['Core']->getEntityManager(); $em = $app['Core']->getEntityManager();
$List = new \Entities\UsrList(); $List = new \Entities\UsrList();
@@ -159,7 +159,7 @@ class UsrLists implements ControllerProviderInterface
$repository = $em->getRepository('\Entities\UsrList'); $repository = $em->getRepository('\Entities\UsrList');
$list = $repository->findUserListByUserAndId($user, $list_id); $list = $repository->findUserListByUserAndId($user, $list_id);
$owners = $entries = $lists = array(); $owners = $entries = $lists = array();
foreach ($list->getOwners() as $owner) foreach ($list->getOwners() as $owner)
@@ -215,16 +215,16 @@ class UsrLists implements ControllerProviderInterface
'success' => false 'success' => false
, 'message' => _('Unable to update list') , 'message' => _('Unable to update list')
); );
try try
{ {
$list_name = $request->get('name'); $list_name = $request->get('name');
if(!$list_name) if(!$list_name)
{ {
throw new ControllerException(_('List name is required')); throw new ControllerException(_('List name is required'));
} }
$user = $app['Core']->getAuthenticatedUser(); $user = $app['Core']->getAuthenticatedUser();
$em = $app['Core']->getEntityManager(); $em = $app['Core']->getEntityManager();
@@ -266,9 +266,9 @@ class UsrLists implements ControllerProviderInterface
try try
{ {
$repository = $em->getRepository('\Entities\UsrList'); $repository = $em->getRepository('\Entities\UsrList');
$user = $app['Core']->getAuthenticatedUser(); $user = $app['Core']->getAuthenticatedUser();
$list = $repository->findUserListByUserAndId($user, $list_id); $list = $repository->findUserListByUserAndId($user, $list_id);
$em->remove($list); $em->remove($list);
@@ -305,19 +305,19 @@ class UsrLists implements ControllerProviderInterface
try try
{ {
$repository = $em->getRepository('\Entities\UsrList'); $repository = $em->getRepository('\Entities\UsrList');
$user = $app['Core']->getAuthenticatedUser(); $user = $app['Core']->getAuthenticatedUser();
$list = $repository->findUserListByUserAndId($user, $list_id); $list = $repository->findUserListByUserAndId($user, $list_id);
/* @var $list \Entities\UsrList */ /* @var $list \Entities\UsrList */
$entry_repository = $em->getRepository('\Entities\UsrListEntry'); $entry_repository = $em->getRepository('\Entities\UsrListEntry');
$user_entry = $entry_repository->findEntryByListAndEntryId($list, $entry_id); $user_entry = $entry_repository->findEntryByListAndEntryId($list, $entry_id);
$em->remove($user_entry); $em->remove($user_entry);
$em->flush(); $em->flush();
$datas = array( $datas = array(
'success' => true 'success' => true
, 'message' => _('Entry removed from list') , 'message' => _('Entry removed from list')
@@ -345,7 +345,7 @@ class UsrLists implements ControllerProviderInterface
{ {
$em = $app['Core']->getEntityManager(); $em = $app['Core']->getEntityManager();
$user = $app['Core']->getAuthenticatedUser(); $user = $app['Core']->getAuthenticatedUser();
try try
{ {
$repository = $em->getRepository('\Entities\UsrList'); $repository = $em->getRepository('\Entities\UsrList');
@@ -399,14 +399,14 @@ class UsrLists implements ControllerProviderInterface
$list = $repository->findUserListByUserAndId($user, $list_id); $list = $repository->findUserListByUserAndId($user, $list_id);
/* @var $list \Entities\UsrList */ /* @var $list \Entities\UsrList */
if($list->getOwner($user)->getRole() < \Entities\UsrListOwner::ROLE_EDITOR) if($list->getOwner($user)->getRole() < \Entities\UsrListOwner::ROLE_EDITOR)
{ {
throw new \Exception('You are not authorized to do this'); throw new \Exception('You are not authorized to do this');
} }
$new_owner = \User_Adapter::getInstance($usr_id, \appbox::get_instance()); $new_owner = \User_Adapter::getInstance($usr_id, \appbox::get_instance());
if($list->hasAccess($new_owner)) if($list->hasAccess($new_owner))
{ {
$owner = $list->getOwner($new_owner); $owner = $list->getOwner($new_owner);
@@ -416,20 +416,20 @@ class UsrLists implements ControllerProviderInterface
$owner = new \Entities\UsrListOwner(); $owner = new \Entities\UsrListOwner();
$owner->setList($list); $owner->setList($list);
$owner->setUser($new_owner); $owner->setUser($new_owner);
$list->addUsrListOwner($owner); $list->addUsrListOwner($owner);
$em->persist($owner); $em->persist($owner);
$em->merge($list); $em->merge($list);
} }
$role = $app['request']->get('role', \Entities\UsrListOwner::ROLE_USER); $role = $app['request']->get('role', \Entities\UsrListOwner::ROLE_USER);
$owner->setRole($role); $owner->setRole($role);
$em->merge($owner); $em->merge($owner);
$em->flush(); $em->flush();
$datas = array( $datas = array(
'success' => true 'success' => true
, 'message' => _('List shared to user') , 'message' => _('List shared to user')
@@ -437,20 +437,20 @@ class UsrLists implements ControllerProviderInterface
} }
catch (\Exception $e) catch (\Exception $e)
{ {
$datas = array( $datas = array(
'success' => false 'success' => false
, 'message' => _('Unable to share the list with the usr') , 'message' => _('Unable to share the list with the usr')
); );
} }
$Json = $app['Core']['Serializer']->serialize($datas, 'json'); $Json = $app['Core']['Serializer']->serialize($datas, 'json');
return new Response($Json, 200, array('Content-Type' => 'application/json')); return new Response($Json, 200, array('Content-Type' => 'application/json'));
} }
); );
/** /**
* UnShare a list to a user * UnShare a list to a user
*/ */
$controllers->post('/list/{list_id}/unshare/{owner_id}/', function(Application $app, $list_id, $owner_id) $controllers->post('/list/{list_id}/unshare/{owner_id}/', function(Application $app, $list_id, $owner_id)
{ {
@@ -463,19 +463,19 @@ class UsrLists implements ControllerProviderInterface
$list = $repository->findUserListByUserAndId($user, $list_id); $list = $repository->findUserListByUserAndId($user, $list_id);
/* @var $list \Entities\UsrList */ /* @var $list \Entities\UsrList */
if($list->getOwner($user)->getList() < \Entities\UsrListOwner::ROLE_ADMIN) if($list->getOwner($user)->getList() < \Entities\UsrListOwner::ROLE_ADMIN)
{ {
throw new \Exception('You are not authorized to do this'); throw new \Exception('You are not authorized to do this');
} }
$owners_repository = $em->getRepository('\Entities\UsrListOwner'); $owners_repository = $em->getRepository('\Entities\UsrListOwner');
$owner = $owners_repository->findByListAndOwner($list, $owner_id); $owner = $owners_repository->findByListAndOwner($list, $owner_id);
$em->remove($owner); $em->remove($owner);
$em->flush(); $em->flush();
$datas = array( $datas = array(
'success' => true 'success' => true
, 'message' => _('Owner removed from list') , 'message' => _('Owner removed from list')
@@ -489,7 +489,7 @@ class UsrLists implements ControllerProviderInterface
, 'message' => _('Unable to add usr to list') , 'message' => _('Unable to add usr to list')
); );
} }
$Json = $app['Core']['Serializer']->serialize($datas, 'json'); $Json = $app['Core']['Serializer']->serialize($datas, 'json');
return new Response($Json, 200, array('Content-Type' => 'application/json')); return new Response($Json, 200, array('Content-Type' => 'application/json'));

View File

@@ -51,11 +51,11 @@ class WorkZone implements ControllerProviderInterface
$controllers->get('/Browse/', function(Application $app) $controllers->get('/Browse/', function(Application $app)
{ {
$date_obj = new \DateTime(); $date_obj = new \DateTime();
$params = array( $params = array(
'CurrentYear' => $date_obj->format('Y') 'CurrentYear' => $date_obj->format('Y')
); );
return new Response( return new Response(
$app['Core']->getTwig()->render('prod/WorkZone/Browser/Browser.html.twig' $app['Core']->getTwig()->render('prod/WorkZone/Browser/Browser.html.twig'
, $params , $params
@@ -76,10 +76,10 @@ class WorkZone implements ControllerProviderInterface
$BasketRepo = $em->getRepository('\Entities\Basket'); $BasketRepo = $em->getRepository('\Entities\Basket');
$Page = (int) $request->get('Page', 0); $Page = (int) $request->get('Page', 0);
$PerPage = 10; $PerPage = 10;
$offsetStart = max(($Page - 1) * $PerPage, 0); $offsetStart = max(($Page - 1) * $PerPage, 0);
$Baskets = $BasketRepo->findWorkzoneBasket( $Baskets = $BasketRepo->findWorkzoneBasket(
$user $user
@@ -106,7 +106,7 @@ class WorkZone implements ControllerProviderInterface
return new Response($app['Core']->getTwig()->render('prod/WorkZone/Browser/Results.html.twig', $params)); return new Response($app['Core']->getTwig()->render('prod/WorkZone/Browser/Results.html.twig', $params));
}); });
$controllers->get('/Browse/Basket/{basket_id}/', function(Application $app, $basket_id) $controllers->get('/Browse/Basket/{basket_id}/', function(Application $app, $basket_id)
{ {
@@ -114,7 +114,7 @@ class WorkZone implements ControllerProviderInterface
$basket = $em->getRepository('\Entities\Basket') $basket = $em->getRepository('\Entities\Basket')
->findUserBasket($basket_id, $app['Core']->getAuthenticatedUser()); ->findUserBasket($basket_id, $app['Core']->getAuthenticatedUser());
$params = array( $params = array(
'Basket'=>$basket 'Basket'=>$basket
); );

View File

@@ -48,17 +48,17 @@ class RSSFeeds implements ControllerProviderInterface
{ {
$content = new \Feed_XML_RSS(); $content = new \Feed_XML_RSS();
} }
if ($format == \Feed_Adapter::FORMAT_ATOM) if ($format == \Feed_Adapter::FORMAT_ATOM)
{ {
$content = new \Feed_XML_Atom(); $content = new \Feed_XML_Atom();
} }
if($format == \Feed_Adapter::FORMAT_COOLIRIS) if($format == \Feed_Adapter::FORMAT_COOLIRIS)
{ {
$content = new \Feed_XML_Cooliris(); $content = new \Feed_XML_Cooliris();
} }
if ($user instanceof \User_Adapter) if ($user instanceof \User_Adapter)
$link = $feed->get_user_link($registry, $user, $format, $page); $link = $feed->get_user_link($registry, $user, $format, $page);
else else
@@ -86,7 +86,7 @@ class RSSFeeds implements ControllerProviderInterface
} }
foreach ($entries->get_entries() as $entry) foreach ($entries->get_entries() as $entry)
$content->set_item($entry); $content->set_item($entry);
$render = $content->render(); $render = $content->render();
$response = new Response($render, 200, array('Content-Type' => $content->get_mimetype())); $response = new Response($render, 200, array('Content-Type' => $content->get_mimetype()));
$response->setCharset('UTF-8'); $response->setCharset('UTF-8');
@@ -180,7 +180,7 @@ class RSSFeeds implements ControllerProviderInterface
return $display_feed($feed, \Feed_Adapter::FORMAT_COOLIRIS , $page); return $display_feed($feed, \Feed_Adapter::FORMAT_COOLIRIS , $page);
}); });
return $controllers; return $controllers;
} }

View File

@@ -132,9 +132,9 @@ class Installer implements ControllerProviderInterface
set_time_limit(360); set_time_limit(360);
\phrasea::use_i18n(\Session_Handler::get_locale()); \phrasea::use_i18n(\Session_Handler::get_locale());
$request = $app['request']; $request = $app['request'];
$servername = $request->getScheme() . '://' . $request->getHttpHost() . '/'; $servername = $request->getScheme() . '://' . $request->getHttpHost() . '/';
$setupRegistry = new \Setup_Registry(); $setupRegistry = new \Setup_Registry();
$setupRegistry->set('GV_ServerName', $servername); $setupRegistry->set('GV_ServerName', $servername);
@@ -168,14 +168,14 @@ class Installer implements ControllerProviderInterface
{ {
return $app->redirect('/setup/installer/step2/?error=' . _('Databox is unreachable')); return $app->redirect('/setup/installer/step2/?error=' . _('Databox is unreachable'));
} }
\setup::rollback($conn, $connbas); \setup::rollback($conn, $connbas);
try try
{ {
$setupRegistry = new \Setup_Registry(); $setupRegistry = new \Setup_Registry();
$setupRegistry->set('GV_ServerName', $servername); $setupRegistry->set('GV_ServerName', $servername);
$appbox = \appbox::create($setupRegistry, $conn, $appbox_name, true); $appbox = \appbox::create($setupRegistry, $conn, $appbox_name, true);
$handler = new \Alchemy\Phrasea\Core\Configuration\Handler( $handler = new \Alchemy\Phrasea\Core\Configuration\Handler(
@@ -196,11 +196,11 @@ class Installer implements ControllerProviderInterface
); );
$ormService = $ormServiceBuilder->buildService(); $ormService = $ormServiceBuilder->buildService();
if ($ormService->getType() === 'doctrine') if ($ormService->getType() === 'doctrine')
{ {
/* @var $em \Doctrine\ORM\EntityManager */ /* @var $em \Doctrine\ORM\EntityManager */
$em = $ormService->getService(); $em = $ormService->getService();
$metadatas = $em->getMetadataFactory()->getAllMetadata(); $metadatas = $em->getMetadataFactory()->getAllMetadata();

View File

@@ -88,4 +88,4 @@ class Upgrader implements ControllerProviderInterface
return $controllers; return $controllers;
} }
} }

View File

@@ -52,7 +52,7 @@ class ConnectionTest implements ControllerProviderInterface
} }
catch (\Exception $e) catch (\Exception $e)
{ {
} }
if ($dbname && $connection_ok === true) if ($dbname && $connection_ok === true)
@@ -85,7 +85,7 @@ class ConnectionTest implements ControllerProviderInterface
} }
catch (\Exception $e) catch (\Exception $e)
{ {
} }
} }

View File

@@ -75,4 +75,4 @@ class PathFileTest implements ControllerProviderInterface
return $controllers; return $controllers;
} }
} }

View File

@@ -18,7 +18,7 @@ use Alchemy\Phrasea\Core\Configuration;
require_once __DIR__ . '/../../vendor/Silex/vendor/pimple/lib/Pimple.php'; require_once __DIR__ . '/../../vendor/Silex/vendor/pimple/lib/Pimple.php';
/** /**
* *
* Phraseanet Core Container * Phraseanet Core Container
* *
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
@@ -149,13 +149,14 @@ class Core extends \Pimple
$gatekeeper = \gatekeeper::getInstance(); $gatekeeper = \gatekeeper::getInstance();
$gatekeeper->check_directory(); $gatekeeper->check_directory();
} }
return; return;
} }
/** /**
* Load Configuration * Load Configuration
* *
* @param type $environnement * @param type $environnement
*/ */
private function init() private function init()
{ {
@@ -175,8 +176,8 @@ class Core extends \Pimple
/** /**
* Getter * Getter
* *
* @return \Registry * @return \Registry
*/ */
public function getRegistry() public function getRegistry()
{ {
@@ -185,8 +186,8 @@ class Core extends \Pimple
/** /**
* Getter * Getter
* *
* @return \Registry * @return \Registry
*/ */
public function getCache() public function getCache()
{ {
@@ -195,8 +196,8 @@ class Core extends \Pimple
/** /**
* Getter * Getter
* *
* @return \Doctrine\ORM\EntityManager * @return \Doctrine\ORM\EntityManager
*/ */
public function getEntityManager() public function getEntityManager()
{ {
@@ -205,7 +206,7 @@ class Core extends \Pimple
/** /**
* Getter * Getter
* *
* @return \Twig_Environment * @return \Twig_Environment
*/ */
public function getTwig() public function getTwig()
@@ -215,8 +216,8 @@ class Core extends \Pimple
/** /**
* Getter * Getter
* *
* @return Alchemy\Phrasea\Core\Version * @return Alchemy\Phrasea\Core\Version
*/ */
public function getVersion() public function getVersion()
{ {
@@ -225,7 +226,7 @@ class Core extends \Pimple
/** /**
* Getter * Getter
* *
* @return \Symfony\Component\Serializer\Serializer * @return \Symfony\Component\Serializer\Serializer
*/ */
public function getSerializer() public function getSerializer()
@@ -235,8 +236,8 @@ class Core extends \Pimple
/** /**
* Tell if current seession is authenticated * Tell if current seession is authenticated
* *
* @return boolean * @return boolean
*/ */
public function isAuthenticated() public function isAuthenticated()
{ {
@@ -247,8 +248,8 @@ class Core extends \Pimple
/** /**
* Return the current authenticated phraseanet user * Return the current authenticated phraseanet user
* *
* @return \User_adapter * @return \User_adapter
*/ */
public function getAuthenticatedUser() public function getAuthenticatedUser()
{ {
@@ -260,7 +261,7 @@ class Core extends \Pimple
/** /**
* Getter * Getter
* *
* @return Core\Configuration * @return Core\Configuration
*/ */
public function getConfiguration() public function getConfiguration()
@@ -309,8 +310,8 @@ class Core extends \Pimple
/** /**
* Initialiaze phraseanet log process * Initialiaze phraseanet log process
* *
* @return Core * @return Core
*/ */
protected function initLoggers() protected function initLoggers()
{ {
@@ -332,8 +333,8 @@ class Core extends \Pimple
/** /**
* Return available language for phraseanet * Return available language for phraseanet
* *
* @return Array * @return Array
*/ */
public static function getAvailableLanguages() public static function getAvailableLanguages()
{ {
@@ -341,8 +342,8 @@ class Core extends \Pimple
} }
/** /**
* Set Language * Set Language
* *
*/ */
protected function detectLanguage() protected function detectLanguage()
{ {
@@ -387,7 +388,7 @@ class Core extends \Pimple
/** /**
* Register directory and namespaces for autoloading app classes * Register directory and namespaces for autoloading app classes
* *
*/ */
public static function initAutoloads() public static function initAutoloads()
{ {
@@ -425,7 +426,7 @@ class Core extends \Pimple
/** /**
* Initialize some PHP configuration variables * Initialize some PHP configuration variables
* *
*/ */
public static function initPHPConf() public static function initPHPConf()
{ {
@@ -446,7 +447,7 @@ class Core extends \Pimple
/** /**
* Return the current working environnement (test, dev, prod etc ...) * Return the current working environnement (test, dev, prod etc ...)
* *
* @return string * @return string
*/ */
public function getEnv() public function getEnv()

View File

@@ -17,7 +17,7 @@ use Alchemy\Phrasea\Core\Configuration\Parser as ConfigurationParser;
/** /**
* Handle configuration file mechanism of phraseanet * Handle configuration file mechanism of phraseanet
* *
* @package * @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
@@ -33,7 +33,7 @@ class Configuration
/** /**
* Class that take care of configuration process * Class that take care of configuration process
* @var Configuration\Handler * @var Configuration\Handler
*/ */
private $configurationHandler; private $configurationHandler;
@@ -44,7 +44,7 @@ class Configuration
private $environment; private $environment;
/** /**
* *
* @param type $envName the name of the loaded environnement * @param type $envName the name of the loaded environnement
*/ */
public function __construct(Configuration\Handler $handler, $environment = null) public function __construct(Configuration\Handler $handler, $environment = null)
@@ -65,7 +65,7 @@ class Configuration
} }
catch (\Exception $e) catch (\Exception $e)
{ {
} }
} }
@@ -80,7 +80,7 @@ class Configuration
/** /**
* Setter * Setter
* @param Configuration\Handler $configurationHandler * @param Configuration\Handler $configurationHandler
*/ */
public function setConfigurationHandler(Configuration\Handler $configurationHandler) public function setConfigurationHandler(Configuration\Handler $configurationHandler)
{ {
@@ -89,8 +89,8 @@ class Configuration
/** /**
* Return the current used environnement * Return the current used environnement
* *
* @return string * @return string
*/ */
public function getEnvironnement() public function getEnvironnement()
{ {
@@ -98,13 +98,14 @@ class Configuration
{ {
$this->getConfiguration(); $this->getConfiguration();
} }
return $this->environment; return $this->environment;
} }
/** /**
* Return the current used environnement * Return the current used environnement
* *
* @return string * @return string
*/ */
public function setEnvironnement($environement = null) public function setEnvironnement($environement = null)
{ {
@@ -114,7 +115,7 @@ class Configuration
/** /**
* Check if current environnement is on debug mode * Check if current environnement is on debug mode
* Default to false * Default to false
* @return boolean * @return boolean
*/ */
public function isDebug() public function isDebug()
{ {
@@ -128,13 +129,14 @@ class Configuration
{ {
$debug = false; $debug = false;
} }
return $debug; return $debug;
} }
/** /**
* Check if phrasea is currently maintained * Check if phrasea is currently maintained
* Default to false * Default to false
* @return boolean * @return boolean
*/ */
public function isMaintained() public function isMaintained()
{ {
@@ -148,13 +150,14 @@ class Configuration
{ {
$maintained = false; $maintained = false;
} }
return $maintained; return $maintained;
} }
/** /**
* Check if current environnement should display errors * Check if current environnement should display errors
* Default to false * Default to false
* @return boolean * @return boolean
*/ */
public function isDisplayingErrors() public function isDisplayingErrors()
{ {
@@ -168,24 +171,26 @@ class Configuration
{ {
$displayErrors = false; $displayErrors = false;
} }
return $displayErrors; return $displayErrors;
} }
/** /**
* Return the phraseanet scope configurations values * Return the phraseanet scope configurations values
* *
* @return ParameterBag * @return ParameterBag
*/ */
public function getPhraseanet() public function getPhraseanet()
{ {
$phraseanetConf = $this->getConfiguration()->get('phraseanet'); $phraseanetConf = $this->getConfiguration()->get('phraseanet');
return new ParameterBag($phraseanetConf); return new ParameterBag($phraseanetConf);
} }
/** /**
* Tell if the application is installed * Tell if the application is installed
* *
* @return boolean * @return boolean
*/ */
public function isInstalled() public function isInstalled()
{ {
@@ -194,13 +199,13 @@ class Configuration
/** /**
* Return the configuration * Return the configuration
* *
* @return ParameterBag\ParameterBag * @return ParameterBag\ParameterBag
*/ */
public function getConfiguration() public function getConfiguration()
{ {
$configuration = array(); $configuration = array();
if ($this->installed) if ($this->installed)
{ {
$configuration = $this->configurationHandler->handle($this->environment); $configuration = $this->configurationHandler->handle($this->environment);
@@ -212,8 +217,8 @@ class Configuration
/** /**
* Return Available logger * Return Available logger
* *
* @return Array * @return Array
*/ */
public function getAvailableDoctrineLogger() public function getAvailableDoctrineLogger()
{ {
@@ -222,7 +227,7 @@ class Configuration
/** /**
* Return the connexion parameters as configuration parameter object * Return the connexion parameters as configuration parameter object
* *
* @return ParameterBag * @return ParameterBag
*/ */
public function getConnexion($name = 'main_connexion') public function getConnexion($name = 'main_connexion')
@@ -250,7 +255,7 @@ class Configuration
/** /**
* Return all connexions defined in connexions.yml * Return all connexions defined in connexions.yml
* @return ParameterBag * @return ParameterBag
*/ */
public function getConnexions() public function getConnexions()
{ {
@@ -262,7 +267,7 @@ class Configuration
/** /**
* Return a the configuration file as an SplFileObject * Return a the configuration file as an SplFileObject
* *
* @return \SplFileObject * @return \SplFileObject
*/ */
public function getFile() public function getFile()
@@ -272,12 +277,13 @@ class Configuration
/** /**
* Return the full configuration file as an Array * Return the full configuration file as an Array
* *
* @return Array * @return Array
*/ */
public function all() public function all()
{ {
$allConf = $this->configurationHandler->getParser()->parse($this->getFile()); $allConf = $this->configurationHandler->getParser()->parse($this->getFile());
return $allConf; return $allConf;
} }
@@ -295,10 +301,10 @@ class Configuration
/** /**
* Write datas in config file * Write datas in config file
* *
* @param array $data * @param array $data
* @param type $flag * @param type $flag
* @return Configuration * @return Configuration
*/ */
public function write(Array $data, $flag = 0, $delete = false) public function write(Array $data, $flag = 0, $delete = false)
{ {
@@ -326,7 +332,7 @@ class Configuration
/** /**
* Delete configuration file * Delete configuration file
* @return Configuration * @return Configuration
*/ */
public function delete() public function delete()
{ {
@@ -339,7 +345,7 @@ class Configuration
} }
catch (\Exception $e) catch (\Exception $e)
{ {
} }
return $this; return $this;
@@ -347,7 +353,7 @@ class Configuration
/** /**
* Return configuration service for template_engine * Return configuration service for template_engine
* @return string * @return string
*/ */
public function getTemplating() public function getTemplating()
{ {
@@ -365,9 +371,9 @@ class Configuration
/** /**
* Return the selected service configuration * Return the selected service configuration
* *
* @param type $name * @param type $name
* @return ParameterBag * @return ParameterBag
*/ */
public function getService($name = 'twig') public function getService($name = 'twig')
{ {
@@ -394,7 +400,7 @@ class Configuration
/** /**
* return the service file * return the service file
* @return \SplFileObject * @return \SplFileObject
*/ */
public function getServiceFile() public function getServiceFile()
{ {
@@ -403,7 +409,7 @@ class Configuration
/** /**
* Return the connexion file * Return the connexion file
* @return \SplFileObject * @return \SplFileObject
*/ */
public function getConnexionFile() public function getConnexionFile()
{ {
@@ -412,7 +418,7 @@ class Configuration
/** /**
* Refresh the configuration * Refresh the configuration
* @return Configuration * @return Configuration
*/ */
public function refresh() public function refresh()
{ {
@@ -439,4 +445,4 @@ class Configuration
return $this; return $this;
} }
} }

View File

@@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Core\Configuration;
/** /**
* Precise some informations about phraseanet configuration mechanism * Precise some informations about phraseanet configuration mechanism
* *
* @package * @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
@@ -44,6 +44,7 @@ class Application implements Specification
, $this->getConfigurationFileName() , $this->getConfigurationFileName()
, $this->getConfigurationFileExtension() , $this->getConfigurationFileExtension()
); );
return $path; return $path;
} }
@@ -67,7 +68,7 @@ class Application implements Specification
/** /**
* Return the selected environnment from configuration file * Return the selected environnment from configuration file
* *
* @return string * @return string
*/ */
public function getSelectedEnv(Array $config) public function getSelectedEnv(Array $config)
@@ -81,8 +82,8 @@ class Application implements Specification
} }
/** /**
* Return the main configuration file * Return the main configuration file
* *
* @return \SplFileObject * @return \SplFileObject
*/ */
public function getConfigurationFile() public function getConfigurationFile()
@@ -91,8 +92,8 @@ class Application implements Specification
} }
/** /**
* Return the main configuration file * Return the main configuration file
* *
* @return \SplFileObject * @return \SplFileObject
*/ */
public function getServiceFile() public function getServiceFile()
@@ -101,8 +102,8 @@ class Application implements Specification
} }
/** /**
* Return the main configuration file * Return the main configuration file
* *
* @return \SplFileObject * @return \SplFileObject
*/ */
public function getConnexionFile() public function getConnexionFile()

View File

@@ -15,7 +15,7 @@ use \Symfony\Component\Yaml\Yaml;
/** /**
* Handle configuration mechanism * Handle configuration mechanism
* *
* @package * @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
@@ -24,27 +24,27 @@ class Handler
{ {
/** /**
* Configuration file specification interface * Configuration file specification interface
* @var ConfigurationSpecification * @var ConfigurationSpecification
*/ */
protected $confSpecification; protected $confSpecification;
/** /**
* A file parser interface * A file parser interface
* @var Parser\ParserInterface * @var Parser\ParserInterface
*/ */
protected $parser; protected $parser;
/** /**
* The environnment selected * The environnment selected
* @var string * @var string
*/ */
private $selectedEnvironnment; private $selectedEnvironnment;
/** /**
* Tell handler the configuration specification ans which parser to use * Tell handler the configuration specification ans which parser to use
* *
* @param ConfigurationSpecification $configSpec * @param ConfigurationSpecification $configSpec
* @param Parser\ParserInterface $parser * @param Parser\ParserInterface $parser
*/ */
public function __construct(Specification $configSpec, Parser $parser) public function __construct(Specification $configSpec, Parser $parser)
{ {
@@ -54,7 +54,7 @@ class Handler
/** /**
* Getter * Getter
* @return Specification * @return Specification
*/ */
public function getSpecification() public function getSpecification()
{ {
@@ -72,7 +72,7 @@ class Handler
/** /**
* Handle the configuration process and return the final configuration * Handle the configuration process and return the final configuration
* *
* @param strinig $name the name of the loaded environnement * @param strinig $name the name of the loaded environnement
* @return Array * @return Array
*/ */
@@ -90,7 +90,7 @@ class Handler
} }
$this->selectedEnvironnment = $selectedEnv; $this->selectedEnvironnment = $selectedEnv;
if (!isset($env[$selectedEnv])) if (!isset($env[$selectedEnv]))
{ {
throw new \Exception(sprintf("The choosen development environment '%s' is not declared in %s", $selectedEnv, $file->getFileName())); throw new \Exception(sprintf("The choosen development environment '%s' is not declared in %s", $selectedEnv, $file->getFileName()));

View File

@@ -34,4 +34,4 @@ class Parameter extends ParameterBag
} }
} }
} }

View File

@@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Core\Configuration;
/** /**
* A interface to parse configuration file * A interface to parse configuration file
* *
* @package * @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
@@ -22,17 +22,17 @@ interface Parser
{ {
/** /**
* Parse the configuration file $file to an array * Parse the configuration file $file to an array
* *
* @param \SplFileObject $file the file to parse * @param \SplFileObject $file the file to parse
* @return Array * @return Array
*/ */
public function parse(\SplFileObject $file); public function parse(\SplFileObject $file);
/** /**
* Dump into string from array * Dump into string from array
* *
* @param $conf * @param $conf
* @return string * @return string
*/ */
public function dump(Array $conf, $level); public function dump(Array $conf, $level);
} }

View File

@@ -14,7 +14,7 @@ use Symfony\Component\Yaml\Yaml as SfYaml;
/** /**
* Parse a configuration file in yaml format and return an array of values * Parse a configuration file in yaml format and return an array of values
* *
* @package * @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
@@ -36,7 +36,7 @@ class Yaml implements \Alchemy\Phrasea\Core\Configuration\Parser
throw new \Exception(sprintf('Failed to parse the configuration file %s', $e->getMessage())); throw new \Exception(sprintf('Failed to parse the configuration file %s', $e->getMessage()));
} }
} }
/** /**
* *
* @Override * @Override
@@ -46,4 +46,4 @@ class Yaml implements \Alchemy\Phrasea\Core\Configuration\Parser
return SfYaml::dump($conf, $level); return SfYaml::dump($conf, $level);
} }
} }

View File

@@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Core\Configuration;
/** /**
* A interface to precise some specific configuration file mechanism * A interface to precise some specific configuration file mechanism
* *
* @package * @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
@@ -22,32 +22,32 @@ interface Specification
{ {
/** /**
* Return the pathname of the configuration file * Return the pathname of the configuration file
* *
* @return string * @return string
*/ */
public function getConfigurationPathName(); public function getConfigurationPathName();
/** /**
* Return the path to the configuration file * Return the path to the configuration file
* *
* @return string * @return string
*/ */
public function getConfigurationFilePath(); public function getConfigurationFilePath();
/** /**
* Return the configurationFile extension * Return the configurationFile extension
* *
* @return string * @return string
*/ */
public function getConfigurationFileExtension(); public function getConfigurationFileExtension();
/** /**
* Return the name of the configuration file * Return the name of the configuration file
* *
* @return string * @return string
*/ */
public function getConfigurationFileName(); public function getConfigurationFileName();
} }

View File

@@ -33,7 +33,7 @@ class ApcCache extends ServiceAbstract implements ServiceInterface
/** /**
* *
* @return Cache\ApcCache * @return Cache\ApcCache
*/ */
public function getService() public function getService()
{ {
@@ -63,7 +63,7 @@ class ApcCache extends ServiceAbstract implements ServiceInterface
{ {
throw new \Exception(sprintf('Registry dependency does not implement registryInterface for %s service', $this->name)); throw new \Exception(sprintf('Registry dependency does not implement registryInterface for %s service', $this->name));
} }
return $registry; return $registry;
} }

View File

@@ -19,7 +19,7 @@ use Doctrine\Common\Cache as CacheService;
/** /**
* Array cache * Array cache
* *
* @package * @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
@@ -34,7 +34,7 @@ class ArrayCache extends ServiceAbstract implements ServiceInterface
/** /**
* *
* @return Cache\ApcCache * @return Cache\ApcCache
*/ */
public function getService() public function getService()
{ {

View File

@@ -48,7 +48,7 @@ class MemcacheCache extends ServiceAbstract implements ServiceInterface
/** /**
* *
* @return Cache\ApcCache * @return Cache\ApcCache
*/ */
public function getService() public function getService()
{ {
@@ -60,11 +60,11 @@ class MemcacheCache extends ServiceAbstract implements ServiceInterface
$memcache = new \Memcache(); $memcache = new \Memcache();
$memcache->addServer($this->host, $this->port); $memcache->addServer($this->host, $this->port);
$key = sprintf("%s:%s", $this->host, $this->port); $key = sprintf("%s:%s", $this->host, $this->port);
$stats = @$memcache->getExtendedStats(); $stats = @$memcache->getExtendedStats();
if ($stats[$key]) if ($stats[$key])
{ {
$memcache->connect($this->host, $this->port); $memcache->connect($this->host, $this->port);

View File

@@ -49,7 +49,7 @@ class MemcachedCache extends ServiceAbstract implements ServiceInterface
/** /**
* *
* @return Cache\ApcCache * @return Cache\ApcCache
*/ */
public function getService() public function getService()
{ {

View File

@@ -49,7 +49,7 @@ class RedisCache extends ServiceAbstract implements ServiceInterface
/** /**
* *
* @return Cache\ApcCache * @return Cache\ApcCache
*/ */
public function getService() public function getService()
{ {

View File

@@ -18,7 +18,7 @@ use Alchemy\Phrasea\Core,
use Doctrine\Common\Cache as CacheService; use Doctrine\Common\Cache as CacheService;
/** /**
* *
* @package * @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
@@ -33,7 +33,7 @@ class XcacheCache extends ServiceAbstract implements ServiceInterface
/** /**
* *
* @return Cache\ApcCache * @return Cache\ApcCache
*/ */
public function getService() public function getService()
{ {
@@ -45,7 +45,7 @@ class XcacheCache extends ServiceAbstract implements ServiceInterface
$registry = $this->getRegistry(); $registry = $this->getRegistry();
$service = new CacheService\XcacheCache(); $service = new CacheService\XcacheCache();
$service->setNamespace($registry->get("GV_sit", "")); $service->setNamespace($registry->get("GV_sit", ""));
return $service; return $service;
@@ -68,4 +68,4 @@ class XcacheCache extends ServiceAbstract implements ServiceInterface
return $registry; return $registry;
} }
} }

View File

@@ -29,11 +29,11 @@ class Monolog extends ParentLog implements ServiceInterface
const JSON_OUTPUT = 'json'; const JSON_OUTPUT = 'json';
const YAML_OUTPUT = 'yaml'; const YAML_OUTPUT = 'yaml';
const VAR_DUMP_OUTPUT = 'vdump'; const VAR_DUMP_OUTPUT = 'vdump';
protected $outputs = array( protected $outputs = array(
self::JSON_OUTPUT, self::YAML_OUTPUT, self::VAR_DUMP_OUTPUT self::JSON_OUTPUT, self::YAML_OUTPUT, self::VAR_DUMP_OUTPUT
); );
public function getService() public function getService()
{ {
$output = isset($this->options["output"]) ? $this->options["output"] : self::JSON_OUTPUT; $output = isset($this->options["output"]) ? $this->options["output"] : self::JSON_OUTPUT;
@@ -41,7 +41,7 @@ class Monolog extends ParentLog implements ServiceInterface
if (!in_array($output, $this->outputs)) if (!in_array($output, $this->outputs))
{ {
throw new \Exception(sprintf( throw new \Exception(sprintf(
"The output type '%s' declared in %s %s service is not valid. "The output type '%s' declared in %s %s service is not valid.
Available types are %s." Available types are %s."
, $output , $output
, $this->name , $this->name
@@ -53,10 +53,10 @@ class Monolog extends ParentLog implements ServiceInterface
return new MonologSQLLogger($this->monolog, $output); return new MonologSQLLogger($this->monolog, $output);
} }
public function getType() public function getType()
{ {
return 'doctrine_monolog'; return 'doctrine_monolog';
} }
} }

View File

@@ -26,7 +26,7 @@ use Doctrine\DBAL\Logging\EchoSQLLogger;
class Phpecho extends ServiceAbstract implements ServiceInterface class Phpecho extends ServiceAbstract implements ServiceInterface
{ {
public function getService() public function getService()
{ {
return new EchoSQLLogger(); return new EchoSQLLogger();
@@ -36,10 +36,10 @@ class Phpecho extends ServiceAbstract implements ServiceInterface
{ {
return 'phpecho'; return 'phpecho';
} }
public function getScope() public function getScope()
{ {
return 'log'; return 'log';
} }
} }

View File

@@ -61,7 +61,7 @@ class Monolog extends ServiceAbstract implements ServiceInterface
if (!array_key_exists($handler, $this->handlers)) if (!array_key_exists($handler, $this->handlers))
{ {
throw new \Exception(sprintf( throw new \Exception(sprintf(
"The handler type '%s' declared in %s %s service is not valid. "The handler type '%s' declared in %s %s service is not valid.
Available types are %s." Available types are %s."
, $handler , $handler
, $this->name , $this->name

View File

@@ -20,7 +20,7 @@ use Doctrine\DBAL\Types\Type,
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
/** /**
* *
* @package * @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
@@ -137,7 +137,7 @@ class Doctrine extends ServiceAbstract implements ServiceInterface
$config->setProxyNamespace('Proxies'); $config->setProxyNamespace('Proxies');
$connexion = isset($options["dbal"]) ? $options["dbal"] : false; $connexion = isset($options["dbal"]) ? $options["dbal"] : false;
if (!$connexion) if (!$connexion)
{ {
throw new \Exception(sprintf( throw new \Exception(sprintf(
@@ -323,9 +323,9 @@ class Doctrine extends ServiceAbstract implements ServiceInterface
} }
/** /**
* *
* *
* @param type $cacheName * @param type $cacheName
*/ */
private function getCache($cacheDoctrine, $serviceName = null) private function getCache($cacheDoctrine, $serviceName = null)
{ {
@@ -360,7 +360,7 @@ class Doctrine extends ServiceAbstract implements ServiceInterface
if (!in_array($type, $this->caches)) if (!in_array($type, $this->caches))
{ {
throw new \Exception(sprintf( throw new \Exception(sprintf(
"The cache type '%s' declared in %s %s service is not valid. "The cache type '%s' declared in %s %s service is not valid.
Available types are %s." Available types are %s."
, $type , $type
, $this->name , $this->name
@@ -408,7 +408,7 @@ class Doctrine extends ServiceAbstract implements ServiceInterface
if (!in_array($type, $this->loggers)) if (!in_array($type, $this->loggers))
{ {
throw new \Exception(sprintf( throw new \Exception(sprintf(
"The logger type '%s' declared in %s %s service is not valid. "The logger type '%s' declared in %s %s service is not valid.
Available types are %s." Available types are %s."
, $type , $type
, $this->name , $this->name

View File

@@ -26,7 +26,7 @@ abstract class ServiceAbstract
protected $name; protected $name;
protected $options; protected $options;
protected $configuration; protected $configuration;
private $dependencies; private $dependencies;
public function __construct($name, Array $options, Array $dependencies) public function __construct($name, Array $options, Array $dependencies)
@@ -34,7 +34,7 @@ abstract class ServiceAbstract
$this->name = $name; $this->name = $name;
$this->options = $options; $this->options = $options;
$this->dependencies = $dependencies; $this->dependencies = $dependencies;
$spec = new Core\Configuration\Application(); $spec = new Core\Configuration\Application();
$parser = new Core\Configuration\Parser\Yaml(); $parser = new Core\Configuration\Parser\Yaml();
$handler = new Core\Configuration\Handler($spec, $parser); $handler = new Core\Configuration\Handler($spec, $parser);
@@ -48,21 +48,21 @@ abstract class ServiceAbstract
{ {
throw new \Exception(sprintf("Unknow dependency %s for %s service ", $name, $this->name)); throw new \Exception(sprintf("Unknow dependency %s for %s service ", $name, $this->name));
} }
return $this->dependencies[$name]; return $this->dependencies[$name];
} }
/** /**
* *
* @return Array * @return Array
*/ */
public function getDependencies() public function getDependencies()
{ {
return $this->dependencies; return $this->dependencies;
} }
/** /**
* *
* @return string * @return string
@@ -90,4 +90,4 @@ abstract class ServiceAbstract
return ''; return '';
} }
} }

View File

@@ -21,12 +21,12 @@ namespace Alchemy\Phrasea\Core\Service;
interface ServiceInterface interface ServiceInterface
{ {
public function getName(); public function getName();
public function getType(); public function getType();
public function getService(); public function getService();
public function getOptions(); public function getOptions();
public function getScope(); public function getScope();
} }

View File

@@ -53,7 +53,7 @@ class Twig extends ServiceAbstract implements ServiceInterface
/** /**
* Load phraseanet global variable * Load phraseanet global variable
* it' s like any other template variable, * it' s like any other template variable,
* except that its available in all templates and macros * except that its available in all templates and macros
* @return void * @return void
*/ */
@@ -199,4 +199,4 @@ class Twig extends ServiceAbstract implements ServiceInterface
return 'template_engine'; return 'template_engine';
} }
} }

View File

@@ -23,7 +23,7 @@ abstract class AbstractBuilder
{ {
protected static $optionsNotMandatory = array(); protected static $optionsNotMandatory = array();
private $service; private $service;
public function __construct($name, ParameterBag $configuration, Array $dependencies = array(), $namespace = null) public function __construct($name, ParameterBag $configuration, Array $dependencies = array(), $namespace = null)
@@ -38,7 +38,7 @@ abstract class AbstractBuilder
/** /**
* *
* @return ServiceAbstract * @return ServiceAbstract
*/ */
public function buildService() public function buildService()
{ {
@@ -49,7 +49,7 @@ abstract class AbstractBuilder
{ {
throw new \Exception("Abstract factory does not create any concrete Service"); throw new \Exception("Abstract factory does not create any concrete Service");
} }
protected static function getServiceOptions($type, ParameterBag $configuration) protected static function getServiceOptions($type, ParameterBag $configuration)
{ {
if(!in_array($type, static::$optionsNotMandatory)) if(!in_array($type, static::$optionsNotMandatory))
@@ -67,7 +67,8 @@ abstract class AbstractBuilder
$options = array(); $options = array();
} }
} }
return $options; return $options;
} }
} }

View File

@@ -23,15 +23,15 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
class Cache extends AbstractBuilder class Cache extends AbstractBuilder
{ {
protected static $optionsNotMandatory = array('apc', 'xcache', 'memcache', 'array', 'memcached', 'redis'); protected static $optionsNotMandatory = array('apc', 'xcache', 'memcache', 'array', 'memcached', 'redis');
public static function create($name, ParameterBag $configuration, Array $dependencies = array(), $namespace = null) public static function create($name, ParameterBag $configuration, Array $dependencies = array(), $namespace = null)
{ {
$type = $configuration->get("type"); $type = $configuration->get("type");
$options = parent::getServiceOptions($type, $configuration); $options = parent::getServiceOptions($type, $configuration);
$className = sprintf("\Alchemy\Phrasea\Core\Service\Cache\%sCache", ucfirst($type)); $className = sprintf("\Alchemy\Phrasea\Core\Service\Cache\%sCache", ucfirst($type));
if (class_exists($className)) if (class_exists($className))
{ {
return new $className($name, $options, $dependencies); return new $className($name, $options, $dependencies);
@@ -46,4 +46,4 @@ class Cache extends AbstractBuilder
} }
} }
} }

View File

@@ -54,4 +54,4 @@ class Log extends AbstractBuilder
} }
} }
} }

View File

@@ -22,15 +22,15 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
*/ */
class Orm extends AbstractBuilder class Orm extends AbstractBuilder
{ {
public static function create($name, ParameterBag $configuration, Array $dependencies = array(), $namespace = null) public static function create($name, ParameterBag $configuration, Array $dependencies = array(), $namespace = null)
{ {
$type = $configuration->get("type"); $type = $configuration->get("type");
$options = parent::getServiceOptions($type, $configuration); $options = parent::getServiceOptions($type, $configuration);
$className = sprintf("\Alchemy\Phrasea\Core\Service\Orm\%s", ucfirst($type)); $className = sprintf("\Alchemy\Phrasea\Core\Service\Orm\%s", ucfirst($type));
if (class_exists($className)) if (class_exists($className))
{ {
return new $className($name, $options, $dependencies); return new $className($name, $options, $dependencies);
@@ -45,4 +45,4 @@ class Orm extends AbstractBuilder
} }
} }
} }

View File

@@ -22,15 +22,15 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
*/ */
class TemplateEngine extends AbstractBuilder class TemplateEngine extends AbstractBuilder
{ {
public static function create($name, ParameterBag $configuration, Array $dependencies = array(), $namespace = null) public static function create($name, ParameterBag $configuration, Array $dependencies = array(), $namespace = null)
{ {
$type = $configuration->get("type"); $type = $configuration->get("type");
$options = parent::getServiceOptions($type, $configuration); $options = parent::getServiceOptions($type, $configuration);
$className = sprintf("\Alchemy\Phrasea\Core\Service\TemplateEngine\%s", ucfirst($type)); $className = sprintf("\Alchemy\Phrasea\Core\Service\TemplateEngine\%s", ucfirst($type));
if (class_exists($className)) if (class_exists($className))
{ {
return new $className($name, $options, $dependencies); return new $className($name, $options, $dependencies);
@@ -45,4 +45,4 @@ class TemplateEngine extends AbstractBuilder
} }
} }
} }

View File

@@ -12,7 +12,7 @@
namespace Alchemy\Phrasea\Core; namespace Alchemy\Phrasea\Core;
/** /**
* *
* @package * @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com

View File

@@ -25,20 +25,20 @@ class Helper
/** /**
* *
* @var \Alchemy\Phrasea\Core\Kernel * @var \Alchemy\Phrasea\Core\Kernel
*/ */
protected $core; protected $core;
/** /**
* *
* @var \Symfony\Component\HttpFoundation\Request * @var \Symfony\Component\HttpFoundation\Request
*/ */
protected $request; protected $request;
/** /**
* *
* @param Kernel $kernel * @param Kernel $kernel
* @return Helper * @return Helper
*/ */
public function __construct(Core $core, Request $Request) public function __construct(Core $core, Request $Request)
{ {
@@ -50,7 +50,7 @@ class Helper
/** /**
* *
* @return \Alchemy\Phrasea\Core * @return \Alchemy\Phrasea\Core
*/ */
public function getCore() public function getCore()
{ {
@@ -59,7 +59,7 @@ class Helper
/** /**
* *
* @return \Symfony\Component\HttpFoundation\Request * @return \Symfony\Component\HttpFoundation\Request
*/ */
public function getRequest() public function getRequest()
{ {

View File

@@ -15,14 +15,14 @@ use Alchemy\Phrasea\Core;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
/** /**
* *
* @package * @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
class Prod extends \Alchemy\Phrasea\Helper\Helper class Prod extends \Alchemy\Phrasea\Helper\Helper
{ {
public function get_search_datas() public function get_search_datas()
{ {
$search_datas = array( $search_datas = array(
@@ -35,7 +35,7 @@ class Prod extends \Alchemy\Phrasea\Helper\Helper
$appbox = \appbox::get_instance(); $appbox = \appbox::get_instance();
$session = $appbox->get_session(); $session = $appbox->get_session();
$user = $this->getCore()->getAuthenticatedUser(); $user = $this->getCore()->getAuthenticatedUser();
$searchSet = $user->getPrefs('search'); $searchSet = $user->getPrefs('search');
foreach ($user->ACL()->get_granted_sbas() as $databox) foreach ($user->ACL()->get_granted_sbas() as $databox)
@@ -75,7 +75,7 @@ class Prod extends \Alchemy\Phrasea\Helper\Helper
else else
$dates[$id] = array('sbas' => array($sbas_id), 'fieldname' => $name); $dates[$id] = array('sbas' => array($sbas_id), 'fieldname' => $name);
} }
if (isset($fields[$name])) if (isset($fields[$name]))
{ {
$fields[$name]['sbas'][] = $sbas_id; $fields[$name]['sbas'][] = $sbas_id;
@@ -108,9 +108,9 @@ class Prod extends \Alchemy\Phrasea\Helper\Helper
return $search_datas; return $search_datas;
} }
public function getRandom() public function getRandom()
{ {
return md5(time() . mt_rand(100000, 999999)); return md5(time() . mt_rand(100000, 999999));
} }
} }

View File

@@ -23,5 +23,5 @@ use Symfony\Component\HttpFoundation\Request;
*/ */
class Bridge extends RecordHelper class Bridge extends RecordHelper
{ {
} }

View File

@@ -18,7 +18,7 @@ use Alchemy\Phrasea\Core,
/** /**
* Edit Record Helper * Edit Record Helper
* This object handles /edit/ request and filters records that user can edit * This object handles /edit/ request and filters records that user can edit
* *
* It prepares metadatas, databases structures. * It prepares metadatas, databases structures.
* *
* @package * @package
@@ -72,14 +72,14 @@ class Edit extends RecordHelper
/** /**
* *
* @var type * @var type
*/ */
protected $has_thesaurus = false; protected $has_thesaurus = false;
/** /**
* *
* @param \Alchemy\Phrasea\Core $core * @param \Alchemy\Phrasea\Core $core
* @return Edit * @return Edit
*/ */
public function __construct(Core $core, Request $Request) public function __construct(Core $core, Request $Request)
{ {
@@ -493,11 +493,12 @@ class Edit extends RecordHelper
} }
catch (Exception $e) catch (Exception $e)
{ {
} }
} }
if (!is_array($request->get('mds'))) if (!is_array($request->get('mds')))
return $this; return $this;
$sbas_id = (int) $request->get('sbid'); $sbas_id = (int) $request->get('sbid');
@@ -544,7 +545,7 @@ class Edit extends RecordHelper
} }
/** /**
* todo : this should not work * todo : this should not work
*/ */
if ($write_edit_el instanceof \databox_field) if ($write_edit_el instanceof \databox_field)
{ {

View File

@@ -45,7 +45,7 @@ class Feed extends RecordHelper
/** /**
* *
* @param \Alchemy\Phrasea\Core $core * @param \Alchemy\Phrasea\Core $core
* @return Feed * @return Feed
*/ */
public function __construct(Core $core, Request $Request) public function __construct(Core $core, Request $Request)
{ {

View File

@@ -15,7 +15,7 @@ use Alchemy\Phrasea\Core;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
/** /**
* *
* @package * @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
@@ -99,7 +99,7 @@ class Helper extends \Alchemy\Phrasea\Helper\Helper
/** /**
* *
* @param \Alchemy\Phrasea\Core $core * @param \Alchemy\Phrasea\Core $core
* @return Helper * @return Helper
*/ */
public function __construct(Core $core, Request $Request) public function __construct(Core $core, Request $Request)
{ {
@@ -195,6 +195,7 @@ class Helper extends \Alchemy\Phrasea\Helper\Helper
if (!$this->is_single_grouping()) if (!$this->is_single_grouping())
throw new Exception('Cannot use ' . __METHOD__ . ' here'); throw new Exception('Cannot use ' . __METHOD__ . ' here');
foreach ($this->get_elements() as $record) foreach ($this->get_elements() as $record)
return $record; return $record;
} }
@@ -287,8 +288,10 @@ class Helper extends \Alchemy\Phrasea\Helper\Helper
public function get_serialize_list() public function get_serialize_list()
{ {
if ($this->is_single_grouping()) if ($this->is_single_grouping())
return $this->get_grouping_head()->get_serialize_key(); return $this->get_grouping_head()->get_serialize_key();
else else
return $this->selection->serialize_list(); return $this->selection->serialize_list();
} }
@@ -303,4 +306,4 @@ class Helper extends \Alchemy\Phrasea\Helper\Helper
return $this; return $this;
} }
} }

View File

@@ -44,7 +44,7 @@ class MoveCollection extends RecordHelper
/** /**
* *
* @param \Alchemy\Phrasea\Core $core * @param \Alchemy\Phrasea\Core $core
* @return MoveCollection * @return MoveCollection
*/ */
public function __construct(Core $core, Request $Request) public function __construct(Core $core, Request $Request)
{ {
@@ -64,6 +64,7 @@ class MoveCollection extends RecordHelper
$this->available_destinations = array(); $this->available_destinations = array();
if (!$this->is_possible) if (!$this->is_possible)
return $this; return $this;
$this->available_destinations = array_keys( $this->available_destinations = array_keys(
@@ -101,17 +102,17 @@ class MoveCollection extends RecordHelper
$user = $this->getCore()->getAuthenticatedUser(); $user = $this->getCore()->getAuthenticatedUser();
$baseId = $request->get('base_id'); $baseId = $request->get('base_id');
$base_dest = $base_dest =
$user->ACL()->has_right_on_base($baseId, 'canaddrecord') ? $user->ACL()->has_right_on_base($baseId, 'canaddrecord') ?
$request->get('base_id') : false; $request->get('base_id') : false;
if(!$user->ACL()->has_right_on_base($baseId, 'canaddrecord')) if(!$user->ACL()->has_right_on_base($baseId, 'canaddrecord'))
{ {
throw new \Exception_Unauthorized(sprintf("%s do not have the permission to move records to %s", $user->get_login())); throw new \Exception_Unauthorized(sprintf("%s do not have the permission to move records to %s", $user->get_login()));
} }
if (!$this->is_possible()) if (!$this->is_possible())
throw new Exception('This action is not possible'); throw new Exception('This action is not possible');
@@ -130,8 +131,8 @@ class MoveCollection extends RecordHelper
} }
} }
} }
$collection = \collection::get_from_base_id($base_dest); $collection = \collection::get_from_base_id($base_dest);
foreach ($this->selection as $record) foreach ($this->selection as $record)

View File

@@ -18,7 +18,7 @@ use Alchemy\Phrasea\Helper\Record\Helper as RecordHelper,
/** /**
* Edit Record Helper * Edit Record Helper
* This object handles /edit/ request and filters records that user can edit * This object handles /edit/ request and filters records that user can edit
* *
* It prepares metadatas, databases structures. * It prepares metadatas, databases structures.
* *
* @package * @package
@@ -33,7 +33,7 @@ class Printer extends RecordHelper
/** /**
* *
* @param \Alchemy\Phrasea\Core $core * @param \Alchemy\Phrasea\Core $core
* @return Printer * @return Printer
*/ */
public function __construct(Core $core, Request $Request) public function __construct(Core $core, Request $Request)
{ {
@@ -68,7 +68,7 @@ class Printer extends RecordHelper
} }
catch (\Exception $e) catch (\Exception $e)
{ {
} }
} }
@@ -87,7 +87,7 @@ class Printer extends RecordHelper
} }
catch (\Exception $e) catch (\Exception $e)
{ {
} }
} }

View File

@@ -18,7 +18,7 @@ use Alchemy\Phrasea\Helper\Record\Helper as RecordHelper,
/** /**
* Edit Record Helper * Edit Record Helper
* This object handles /edit/ request and filters records that user can edit * This object handles /edit/ request and filters records that user can edit
* *
* It prepares metadatas, databases structures. * It prepares metadatas, databases structures.
* *
* @package * @package
@@ -29,7 +29,7 @@ class Push extends RecordHelper
{ {
protected $flatten_groupings = true; protected $flatten_groupings = true;
protected $required_rights = array('canpush'); protected $required_rights = array('canpush');
} }

View File

@@ -433,7 +433,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
$rights[$k] = $right . '_' . $base_id; $rights[$k] = $right . '_' . $base_id;
} }
$parm = $request->get_parms_from_serialized_datas($rights, 'values'); $parm = $request->get_parms_from_serialized_datas($rights, 'values');
foreach ($parm as $p => $v) foreach ($parm as $p => $v)
{ {
if (trim($v) == '') if (trim($v) == '')
@@ -602,7 +602,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
} }
$current_user = \User_adapter::getInstance($session->get_usr_id(), $appbox); $current_user = \User_adapter::getInstance($session->get_usr_id(), $appbox);
$base_ids = array_keys($current_user->ACL()->get_granted_base(array('canadmin'))); $base_ids = array_keys($current_user->ACL()->get_granted_base(array('canadmin')));
foreach ($this->users as $usr_id) foreach ($this->users as $usr_id)

View File

@@ -140,8 +140,8 @@ class Manage extends \Alchemy\Phrasea\Helper\Helper
if (is_null($v)) if (is_null($v))
$this->query_parms[$k] = false; $this->query_parms[$k] = false;
} }
$query = new \User_Query($appbox); $query = new \User_Query($appbox);
$templates = $query $templates = $query
->only_templates(true) ->only_templates(true)

View File

@@ -15,7 +15,7 @@ use Alchemy\Phrasea\Core;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
/** /**
* *
* WorkZone provides methods for working with the working zone of Phraseanet * WorkZone provides methods for working with the working zone of Phraseanet
* Production. This zones handles Non-Archived baskets, stories and Validation * Production. This zones handles Non-Archived baskets, stories and Validation
* people are waiting from me. * people are waiting from me.
@@ -26,20 +26,20 @@ use Symfony\Component\HttpFoundation\Request;
*/ */
class WorkZone extends Helper class WorkZone extends Helper
{ {
const BASKETS = 'baskets'; const BASKETS = 'baskets';
const STORIES = 'stories'; const STORIES = 'stories';
const VALIDATIONS = 'validations'; const VALIDATIONS = 'validations';
/** /**
* *
* Returns an ArrayCollection containing three keys : * Returns an ArrayCollection containing three keys :
* - self::BASKETS : an ArrayCollection of the actives baskets * - self::BASKETS : an ArrayCollection of the actives baskets
* (Non Archived) * (Non Archived)
* - self::STORIES : an ArrayCollection of working stories * - self::STORIES : an ArrayCollection of working stories
* - self::VALIDATIONS : the validation people are waiting from me * - self::VALIDATIONS : the validation people are waiting from me
* *
* @return \Doctrine\Common\Collections\ArrayCollection * @return \Doctrine\Common\Collections\ArrayCollection
*/ */
public function getContent() public function getContent()
{ {
@@ -51,17 +51,17 @@ class WorkZone extends Helper
$ret = new \Doctrine\Common\Collections\ArrayCollection(); $ret = new \Doctrine\Common\Collections\ArrayCollection();
$baskets = $repo_baskets->findActiveByUser($current_user); $baskets = $repo_baskets->findActiveByUser($current_user);
$validations = $repo_baskets->findActiveValidationByUser($current_user); $validations = $repo_baskets->findActiveValidationByUser($current_user);
/* @var $repo_stories \Doctrine\Repositories\StoryWZRepository */ /* @var $repo_stories \Doctrine\Repositories\StoryWZRepository */
$repo_stories = $em->getRepository('Entities\StoryWZ'); $repo_stories = $em->getRepository('Entities\StoryWZ');
$ret->set(self::BASKETS, $baskets); $ret->set(self::BASKETS, $baskets);
$ret->set(self::VALIDATIONS, $validations); $ret->set(self::VALIDATIONS, $validations);
$ret->set(self::STORIES, $repo_stories->findByUser($current_user)); $ret->set(self::STORIES, $repo_stories->findByUser($current_user));
return $ret; return $ret;
} }

View File

@@ -17,7 +17,7 @@ require_once __DIR__ . '/../../../../vendor/tcpdf/tcpdf.php';
/** /**
* Creates a PDF * Creates a PDF
* *
* @package * @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com

View File

@@ -12,7 +12,7 @@
namespace Alchemy\Phrasea\Out\Tool; namespace Alchemy\Phrasea\Out\Tool;
/** /**
* *
* @package * @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
@@ -23,7 +23,7 @@ class PhraseaPDF extends \TCPDF
function Header() function Header()
{ {
} }
function Footer() function Footer()
@@ -32,13 +32,13 @@ class PhraseaPDF extends \TCPDF
$mr = $this->SetRightMargin(0); $mr = $this->SetRightMargin(0);
$this->SetY(-15); $this->SetY(-15);
$this->SetFont(self::FONT, 'I', 8); $this->SetFont(self::FONT, 'I', 8);
$this->Cell(0, 10, 'Page ' . $this->PageNo(), 0, 0, 'C'); $this->Cell(0, 10, 'Page ' . $this->PageNo(), 0, 0, 'C');
$this->SetFont(self::FONT, '', 8); $this->SetFont(self::FONT, '', 8);
$w = $this->GetStringWidth('Printed by'); $w = $this->GetStringWidth('Printed by');
$this->SetFont(self::FONT, 'B', 8); $this->SetFont(self::FONT, 'B', 8);
$w += $this->GetStringWidth(' Phraseanet'); $w += $this->GetStringWidth(' Phraseanet');
@@ -46,7 +46,7 @@ class PhraseaPDF extends \TCPDF
$this->SetFont(self::FONT, '', 8); $this->SetFont(self::FONT, '', 8);
$this->Write(8, 'Printed by'); $this->Write(8, 'Printed by');
$this->SetFont(self::FONT, 'B', 8); $this->SetFont(self::FONT, 'B', 8);
$this->Write(8, ' Phraseanet'); $this->Write(8, ' Phraseanet');
} }

View File

@@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Vocabulary\ControlProvider;
/** /**
* ControlProvider Interface * ControlProvider Interface
* *
* This interface should be used to interconnect vocabularies and metadatas * This interface should be used to interconnect vocabularies and metadatas
* *
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
@@ -24,19 +24,19 @@ interface ControlProviderInterface
/** /**
* @return the type of the ControlProvider * @return the type of the ControlProvider
* *
* ControlProvider class should be named like {type}Provider * ControlProvider class should be named like {type}Provider
* in the ControlProvider namespace * in the ControlProvider namespace
*/ */
public static function getType(); public static function getType();
/** /**
* @return stringa simple i18n word to reprsent this vocabullary * @return stringa simple i18n word to reprsent this vocabullary
*/ */
public static function getName(); public static function getName();
/** /**
* @return boolean validate an $id in the vocabulary * @return boolean validate an $id in the vocabulary
*/ */
public static function validate($id); public static function validate($id);
@@ -48,13 +48,13 @@ interface ControlProviderInterface
/** /**
* Find matching Term in the vocabulary repository * Find matching Term in the vocabulary repository
* *
* @param string $query A scalar quaery * @param string $query A scalar quaery
* @param \User_Adapter $for_user The user doing the query * @param \User_Adapter $for_user The user doing the query
* @param \databox $on_databox The databox where vocabulary should be requested * @param \databox $on_databox The databox where vocabulary should be requested
* *
* @return Doctrine\Common\Collections\ArrayCollection * @return Doctrine\Common\Collections\ArrayCollection
*/ */
public static function find($query, \User_Adapter $for_user, \databox $on_databox); public static function find($query, \User_Adapter $for_user, \databox $on_databox);
} }

View File

@@ -23,7 +23,7 @@ class UserProvider implements ControlProviderInterface
{ {
/** /**
* @return string * @return string
*/ */
public static function getType() public static function getType()
{ {
@@ -32,7 +32,7 @@ class UserProvider implements ControlProviderInterface
/** /**
* *
* @return type * @return type
*/ */
public static function getName() public static function getName()
{ {
@@ -44,7 +44,7 @@ class UserProvider implements ControlProviderInterface
* @param string $query * @param string $query
* @param \User_Adapter $for_user * @param \User_Adapter $for_user
* @param \databox $on_databox * @param \databox $on_databox
* @return \Doctrine\Common\Collections\ArrayCollection * @return \Doctrine\Common\Collections\ArrayCollection
*/ */
public static function find($query, \User_Adapter $for_user, \databox $on_databox) public static function find($query, \User_Adapter $for_user, \databox $on_databox)
{ {
@@ -75,18 +75,19 @@ class UserProvider implements ControlProviderInterface
/** /**
* *
* @param mixed $id * @param mixed $id
* @return boolean * @return boolean
*/ */
public static function validate($id) public static function validate($id)
{ {
try try
{ {
\User_Adapter::getInstance($id, appbox::get_instance()); \User_Adapter::getInstance($id, appbox::get_instance());
return true; return true;
} }
catch (\Exception $e) catch (\Exception $e)
{ {
} }
return false; return false;
@@ -95,7 +96,7 @@ class UserProvider implements ControlProviderInterface
/** /**
* *
* @param mixed $id * @param mixed $id
* @return string * @return string
*/ */
public static function getValue($id) public static function getValue($id)
{ {

View File

@@ -12,8 +12,8 @@
namespace Alchemy\Phrasea\Vocabulary; namespace Alchemy\Phrasea\Vocabulary;
/** /**
* Vocabulary Controller * Vocabulary Controller
* *
* Various methods fro controlling vocabularies inside Phraseanet * Various methods fro controlling vocabularies inside Phraseanet
* *
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
@@ -44,7 +44,7 @@ class Controller
/** /**
* Returns an array of available ControlProviders * Returns an array of available ControlProviders
* *
* @return array * @return array
*/ */
public static function getAvailable() public static function getAvailable()
{ {

View File

@@ -13,10 +13,10 @@ namespace Alchemy\Phrasea\Vocabulary\ControlProvider;
/** /**
* Vocabulary Term * Vocabulary Term
* *
* A Term of vocabulary has a Value, and optionnal context, ControllerProvider * A Term of vocabulary has a Value, and optionnal context, ControllerProvider
* and an Id * and an Id
* *
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
*/ */
@@ -25,38 +25,38 @@ class Term
/** /**
* *
* @var string * @var string
*/ */
protected $value; protected $value;
/** /**
* *
* @var string * @var string
*/ */
protected $context; protected $context;
/** /**
* *
* @var ControlProviderInterface * @var ControlProviderInterface
*/ */
protected $type; protected $type;
/** /**
* *
* @var mixed * @var mixed
*/ */
protected $id; protected $id;
/** /**
* Construct a Term * Construct a Term
* *
* @param string $value the scalar value of the Term * @param string $value the scalar value of the Term
* @param string $context A string defining the context of the Term * @param string $context A string defining the context of the Term
* @param ControlProviderInterface $type A Vocabulary Controller * @param ControlProviderInterface $type A Vocabulary Controller
* @param mixed $id The id of the term in the Vocabulary Controller * @param mixed $id The id of the term in the Vocabulary Controller
* *
* @return \Alchemy\Phrasea\Vocabulary\ControlProvider\Term * @return \Alchemy\Phrasea\Vocabulary\ControlProvider\Term
* @throws Exception * @throws Exception
*/ */
public function __construct($value, $context = null, ControlProviderInterface $type = null, $id = null) public function __construct($value, $context = null, ControlProviderInterface $type = null, $id = null)
{ {
@@ -76,8 +76,8 @@ class Term
/** /**
* Get the scalar value of a term * Get the scalar value of a term
* *
* @return string * @return string
*/ */
public function getValue() public function getValue()
{ {
@@ -86,8 +86,8 @@ class Term
/** /**
* Get the content of a term * Get the content of a term
* *
* @return string * @return string
*/ */
public function getContext() public function getContext()
{ {
@@ -95,8 +95,8 @@ class Term
} }
/** /**
* *
* @return ControlProviderInterface * @return ControlProviderInterface
*/ */
public function getType() public function getType()
{ {
@@ -105,11 +105,11 @@ class Term
/** /**
* *
* @return mixed * @return mixed
*/ */
public function getId() public function getId()
{ {
return $this->id; return $this->id;
} }
} }

View File

@@ -76,7 +76,7 @@ class Basket
/** /**
* Get id * Get id
* *
* @return integer * @return integer
*/ */
public function getId() public function getId()
{ {
@@ -96,7 +96,7 @@ class Basket
/** /**
* Get name * Get name
* *
* @return string * @return string
*/ */
public function getName() public function getName()
{ {
@@ -116,7 +116,7 @@ class Basket
/** /**
* Get description * Get description
* *
* @return text * @return text
*/ */
public function getDescription() public function getDescription()
{ {
@@ -136,7 +136,7 @@ class Basket
/** /**
* Get usr_id * Get usr_id
* *
* @return integer * @return integer
*/ */
public function getUsrId() public function getUsrId()
{ {
@@ -156,7 +156,7 @@ class Basket
/** /**
* Get pusher_id * Get pusher_id
* *
* @return integer * @return integer
*/ */
public function getPusherId() public function getPusherId()
{ {
@@ -176,7 +176,7 @@ class Basket
/** /**
* Get archived * Get archived
* *
* @return boolean * @return boolean
*/ */
public function getArchived() public function getArchived()
{ {
@@ -196,7 +196,7 @@ class Basket
/** /**
* Get created * Get created
* *
* @return datetime * @return datetime
*/ */
public function getCreated() public function getCreated()
{ {
@@ -216,7 +216,7 @@ class Basket
/** /**
* Get updated * Get updated
* *
* @return datetime * @return datetime
*/ */
public function getUpdated() public function getUpdated()
{ {
@@ -236,7 +236,7 @@ class Basket
/** /**
* Get elements * Get elements
* *
* @return Doctrine\Common\Collections\Collection * @return Doctrine\Common\Collections\Collection
*/ */
public function getElements() public function getElements()
{ {
@@ -287,7 +287,7 @@ class Basket
/** /**
* Get validation * Get validation
* *
* @return Entities\ValidationSession * @return Entities\ValidationSession
*/ */
public function getValidation() public function getValidation()
{ {
@@ -312,7 +312,7 @@ class Basket
/** /**
* Get is_read * Get is_read
* *
* @return boolean * @return boolean
*/ */
public function getIsRead() public function getIsRead()
{ {
@@ -349,7 +349,7 @@ class Basket
} }
catch (Exception $e) catch (Exception $e)
{ {
} }
} }
@@ -358,4 +358,4 @@ class Basket
return $totSize; return $totSize;
} }
} }

View File

@@ -61,7 +61,7 @@ class BasketElement
/** /**
* Get id * Get id
* *
* @return integer * @return integer
*/ */
public function getId() public function getId()
{ {
@@ -81,7 +81,7 @@ class BasketElement
/** /**
* Get record_id * Get record_id
* *
* @return integer * @return integer
*/ */
public function getRecordId() public function getRecordId()
{ {
@@ -101,7 +101,7 @@ class BasketElement
/** /**
* Get sbas_id * Get sbas_id
* *
* @return integer * @return integer
*/ */
public function getSbasId() public function getSbasId()
{ {
@@ -121,7 +121,7 @@ class BasketElement
/** /**
* Get ord * Get ord
* *
* @return integer * @return integer
*/ */
public function getOrd() public function getOrd()
{ {
@@ -141,7 +141,7 @@ class BasketElement
/** /**
* Get created * Get created
* *
* @return datetime * @return datetime
*/ */
public function getCreated() public function getCreated()
{ {
@@ -161,7 +161,7 @@ class BasketElement
/** /**
* Get updated * Get updated
* *
* @return datetime * @return datetime
*/ */
public function getUpdated() public function getUpdated()
{ {
@@ -181,7 +181,7 @@ class BasketElement
/** /**
* Get basket * Get basket
* *
* @return Entities\Basket * @return Entities\Basket
*/ */
public function getBasket() public function getBasket()
{ {
@@ -227,7 +227,7 @@ class BasketElement
/** /**
* Get validation_datas * Get validation_datas
* *
* @return Doctrine\Common\Collections\Collection * @return Doctrine\Common\Collections\Collection
*/ */
public function getValidationDatas() public function getValidationDatas()
{ {
@@ -237,7 +237,7 @@ class BasketElement
/** /**
* *
* @param \User_Adapter $user * @param \User_Adapter $user
* @return \Entities\ValidationData * @return \Entities\ValidationData
*/ */
public function getUserValidationDatas(\User_Adapter $user) public function getUserValidationDatas(\User_Adapter $user)
{ {
@@ -253,4 +253,4 @@ class BasketElement
throw new \Exception('There is no such participant'); throw new \Exception('There is no such participant');
} }
} }

View File

@@ -53,7 +53,7 @@ class StoryWZ
/** /**
* Get id * Get id
* *
* @return integer * @return integer
*/ */
public function getId() public function getId()
{ {
@@ -73,7 +73,7 @@ class StoryWZ
/** /**
* Get sbas_id * Get sbas_id
* *
* @return integer * @return integer
*/ */
public function getSbasId() public function getSbasId()
{ {
@@ -93,7 +93,7 @@ class StoryWZ
/** /**
* Get record_id * Get record_id
* *
* @return integer * @return integer
*/ */
public function getRecordId() public function getRecordId()
{ {
@@ -113,7 +113,7 @@ class StoryWZ
/** /**
* Get usr_id * Get usr_id
* *
* @return integer * @return integer
*/ */
public function getUsrId() public function getUsrId()
{ {
@@ -133,7 +133,7 @@ class StoryWZ
/** /**
* Get created * Get created
* *
* @return datetime * @return datetime
*/ */
public function getCreated() public function getCreated()
{ {
@@ -164,4 +164,4 @@ class StoryWZ
$this->setSbasId($record->get_sbas_id()); $this->setSbasId($record->get_sbas_id());
} }
} }

View File

@@ -58,7 +58,7 @@ class UsrList
/** /**
* Get id * Get id
* *
* @return integer * @return integer
*/ */
public function getId() public function getId()
{ {
@@ -78,7 +78,7 @@ class UsrList
/** /**
* Get name * Get name
* *
* @return string * @return string
*/ */
public function getName() public function getName()
{ {
@@ -98,7 +98,7 @@ class UsrList
/** /**
* Get created * Get created
* *
* @return datetime * @return datetime
*/ */
public function getCreated() public function getCreated()
{ {
@@ -118,7 +118,7 @@ class UsrList
/** /**
* Get updated * Get updated
* *
* @return datetime * @return datetime
*/ */
public function getUpdated() public function getUpdated()
{ {
@@ -138,7 +138,7 @@ class UsrList
/** /**
* Get owners * Get owners
* *
* @return Doctrine\Common\Collections\Collection * @return Doctrine\Common\Collections\Collection
*/ */
public function getOwners() public function getOwners()
{ {
@@ -150,6 +150,7 @@ class UsrList
foreach ($this->getOwners() as $owner) foreach ($this->getOwners() as $owner)
{ {
if ($owner->getUser()->get_id() == $user->get_id()) if ($owner->getUser()->get_id() == $user->get_id())
return true; return true;
} }
@@ -159,13 +160,14 @@ class UsrList
/** /**
* *
* @param \User_Adapter $user * @param \User_Adapter $user
* @return \Entities\UsrListOwner * @return \Entities\UsrListOwner
*/ */
public function getOwner(\User_Adapter $user) public function getOwner(\User_Adapter $user)
{ {
foreach ($this->getOwners() as $owner) foreach ($this->getOwners() as $owner)
{ {
if ($owner->getUser()->get_id() == $user->get_id()) if ($owner->getUser()->get_id() == $user->get_id())
return $owner; return $owner;
} }
@@ -185,11 +187,11 @@ class UsrList
/** /**
* Get entries * Get entries
* *
* @return Doctrine\Common\Collections\Collection * @return Doctrine\Common\Collections\Collection
*/ */
public function getEntries() public function getEntries()
{ {
return $this->entries; return $this->entries;
} }
} }

View File

@@ -47,7 +47,7 @@ class UsrListEntry
/** /**
* Get id * Get id
* *
* @return integer * @return integer
*/ */
public function getId() public function getId()
{ {
@@ -67,7 +67,7 @@ class UsrListEntry
/** /**
* Get usr_id * Get usr_id
* *
* @return integer * @return integer
*/ */
public function getUsrId() public function getUsrId()
{ {
@@ -87,7 +87,7 @@ class UsrListEntry
/** /**
* Get created * Get created
* *
* @return datetime * @return datetime
*/ */
public function getCreated() public function getCreated()
{ {
@@ -107,7 +107,7 @@ class UsrListEntry
/** /**
* Get updated * Get updated
* *
* @return datetime * @return datetime
*/ */
public function getUpdated() public function getUpdated()
{ {
@@ -127,7 +127,7 @@ class UsrListEntry
/** /**
* Get list * Get list
* *
* @return Entities\UsrList * @return Entities\UsrList
*/ */
public function getList() public function getList()
{ {
@@ -143,4 +143,4 @@ class UsrListEntry
return $this->setUsrId($user->get_id()); return $this->setUsrId($user->get_id());
} }
} }

View File

@@ -55,7 +55,7 @@ class UsrListOwner
/** /**
* Get id * Get id
* *
* @return integer * @return integer
*/ */
public function getId() public function getId()
{ {
@@ -75,7 +75,7 @@ class UsrListOwner
/** /**
* Get usr_id * Get usr_id
* *
* @return integer * @return integer
*/ */
public function getUsrId() public function getUsrId()
{ {
@@ -98,7 +98,7 @@ class UsrListOwner
/** /**
* Get role * Get role
* *
* @return string * @return string
*/ */
public function getRole() public function getRole()
{ {
@@ -118,7 +118,7 @@ class UsrListOwner
/** /**
* Get created * Get created
* *
* @return datetime * @return datetime
*/ */
public function getCreated() public function getCreated()
{ {
@@ -138,7 +138,7 @@ class UsrListOwner
/** /**
* Get updated * Get updated
* *
* @return datetime * @return datetime
*/ */
public function getUpdated() public function getUpdated()
{ {
@@ -158,7 +158,7 @@ class UsrListOwner
/** /**
* Get list * Get list
* *
* @return Entities\UsrList * @return Entities\UsrList
*/ */
public function getList() public function getList()
{ {
@@ -175,4 +175,4 @@ class UsrListOwner
return \User_Adapter::getInstance($this->getUsrId(), \appbox::get_instance()); return \User_Adapter::getInstance($this->getUsrId(), \appbox::get_instance());
} }
} }

View File

@@ -10,7 +10,7 @@
*/ */
namespace Entities; namespace Entities;
/** /**
* *
* @package * @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
@@ -51,7 +51,7 @@ class ValidationData
/** /**
* Get id * Get id
* *
* @return integer * @return integer
*/ */
public function getId() public function getId()
{ {
@@ -71,7 +71,7 @@ class ValidationData
/** /**
* Get agreement * Get agreement
* *
* @return boolean * @return boolean
*/ */
public function getAgreement() public function getAgreement()
{ {
@@ -91,7 +91,7 @@ class ValidationData
/** /**
* Get note * Get note
* *
* @return text * @return text
*/ */
public function getNote() public function getNote()
{ {
@@ -111,7 +111,7 @@ class ValidationData
/** /**
* Get updated * Get updated
* *
* @return datetime * @return datetime
*/ */
public function getUpdated() public function getUpdated()
{ {
@@ -131,7 +131,7 @@ class ValidationData
/** /**
* Get participant * Get participant
* *
* @return Entities\ValidationParticipant * @return Entities\ValidationParticipant
*/ */
public function getParticipant() public function getParticipant()
{ {
@@ -151,10 +151,10 @@ class ValidationData
/** /**
* Get basket_element * Get basket_element
* *
* @return Entities\BasketElement * @return Entities\BasketElement
*/ */
public function getBasketElement() public function getBasketElement()
{ {
return $this->basket_element; return $this->basket_element;
} }
} }

View File

@@ -12,7 +12,7 @@
namespace Entities; namespace Entities;
/** /**
* *
* @package * @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
@@ -73,7 +73,7 @@ class ValidationParticipant
/** /**
* Get id * Get id
* *
* @return integer * @return integer
*/ */
public function getId() public function getId()
{ {
@@ -93,7 +93,7 @@ class ValidationParticipant
/** /**
* Get usr_id * Get usr_id
* *
* @return integer * @return integer
*/ */
public function getUsrId() public function getUsrId()
{ {
@@ -123,7 +123,7 @@ class ValidationParticipant
/** /**
* Get session * Get session
* *
* @return Entities\ValidationSession * @return Entities\ValidationSession
*/ */
public function getSession() public function getSession()
{ {
@@ -143,7 +143,7 @@ class ValidationParticipant
/** /**
* Get is_aware * Get is_aware
* *
* @return boolean * @return boolean
*/ */
public function getIsAware() public function getIsAware()
{ {
@@ -153,11 +153,12 @@ class ValidationParticipant
/** /**
* *
* @param \User_Adapter $user * @param \User_Adapter $user
* @return ValidationParticipant * @return ValidationParticipant
*/ */
public function setUser(\User_Adapter $user) public function setUser(\User_Adapter $user)
{ {
$this->usr_id = $user->get_id(); $this->usr_id = $user->get_id();
return $this; return $this;
} }
@@ -179,7 +180,7 @@ class ValidationParticipant
/** /**
* Get reminded * Get reminded
* *
* @return datetime * @return datetime
*/ */
public function getReminded() public function getReminded()
{ {
@@ -189,7 +190,7 @@ class ValidationParticipant
/** /**
* Get datas * Get datas
* *
* @return Doctrine\Common\Collections\Collection * @return Doctrine\Common\Collections\Collection
*/ */
public function getDatas() public function getDatas()
{ {
@@ -209,7 +210,7 @@ class ValidationParticipant
/** /**
* Get is_confirmed * Get is_confirmed
* *
* @return boolean * @return boolean
*/ */
public function getIsConfirmed() public function getIsConfirmed()
{ {
@@ -229,7 +230,7 @@ class ValidationParticipant
/** /**
* Get can_agree * Get can_agree
* *
* @return boolean * @return boolean
*/ */
public function getCanAgree() public function getCanAgree()
{ {
@@ -249,7 +250,7 @@ class ValidationParticipant
/** /**
* Get can_see_others * Get can_see_others
* *
* @return boolean * @return boolean
*/ */
public function getCanSeeOthers() public function getCanSeeOthers()
{ {
@@ -276,4 +277,4 @@ class ValidationParticipant
return true; return true;
} }
} }

View File

@@ -78,7 +78,7 @@ class ValidationSession
/** /**
* Get id * Get id
* *
* @return integer * @return integer
*/ */
public function getId() public function getId()
{ {
@@ -98,7 +98,7 @@ class ValidationSession
/** /**
* Get name * Get name
* *
* @return string * @return string
*/ */
public function getName() public function getName()
{ {
@@ -118,7 +118,7 @@ class ValidationSession
/** /**
* Get description * Get description
* *
* @return text * @return text
*/ */
public function getDescription() public function getDescription()
{ {
@@ -138,7 +138,7 @@ class ValidationSession
/** /**
* Get archived * Get archived
* *
* @return boolean * @return boolean
*/ */
public function getArchived() public function getArchived()
{ {
@@ -158,7 +158,7 @@ class ValidationSession
/** /**
* Get created * Get created
* *
* @return datetime * @return datetime
*/ */
public function getCreated() public function getCreated()
{ {
@@ -178,7 +178,7 @@ class ValidationSession
/** /**
* Get updated * Get updated
* *
* @return datetime * @return datetime
*/ */
public function getUpdated() public function getUpdated()
{ {
@@ -198,7 +198,7 @@ class ValidationSession
/** /**
* Get expires * Get expires
* *
* @return datetime * @return datetime
*/ */
public function getExpires() public function getExpires()
{ {
@@ -218,7 +218,7 @@ class ValidationSession
/** /**
* Get reminded * Get reminded
* *
* @return datetime * @return datetime
*/ */
public function getReminded() public function getReminded()
{ {
@@ -238,7 +238,7 @@ class ValidationSession
/** /**
* Get basket * Get basket
* *
* @return Entities\Basket * @return Entities\Basket
*/ */
public function getBasket() public function getBasket()
{ {
@@ -258,7 +258,7 @@ class ValidationSession
/** /**
* Get participants * Get participants
* *
* @return Doctrine\Common\Collections\Collection * @return Doctrine\Common\Collections\Collection
*/ */
public function getParticipants() public function getParticipants()
{ {
@@ -306,7 +306,7 @@ class ValidationSession
/** /**
* Get initiator_id * Get initiator_id
* *
* @return integer * @return integer
*/ */
public function getInitiatorId() public function getInitiatorId()
{ {
@@ -321,6 +321,7 @@ class ValidationSession
public function setInitiator(\User_Adapter $user) public function setInitiator(\User_Adapter $user)
{ {
$this->initiator_id = $user->get_id(); $this->initiator_id = $user->get_id();
return; return;
} }
@@ -383,4 +384,4 @@ class ValidationSession
} }
} }
} }

View File

@@ -16,7 +16,7 @@ use Monolog\Handler\StreamHandler;
/** /**
* Log doctrine sql request with monolog * Log doctrine sql request with monolog
* *
* @package * @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com * @link www.phraseanet.com
@@ -26,7 +26,7 @@ class MonologSQLLogger implements \Doctrine\DBAL\Logging\SQLLogger
const JSON = 'json'; const JSON = 'json';
const YAML = 'yaml'; const YAML = 'yaml';
const VDUMP = 'vdump'; const VDUMP = 'vdump';
/** /**
* *
* @var \Monolog\Logger * @var \Monolog\Logger
@@ -38,7 +38,7 @@ class MonologSQLLogger implements \Doctrine\DBAL\Logging\SQLLogger
/** /**
* Tell which monolog user to use and which format to output * Tell which monolog user to use and which format to output
* *
* @param \Monolog\Logger $logger A monolog logger instance * @param \Monolog\Logger $logger A monolog logger instance
* @param type $type the output format * @param type $type the output format
*/ */
@@ -90,4 +90,4 @@ class MonologSQLLogger implements \Doctrine\DBAL\Logging\SQLLogger
$this->logger->debug($message); $this->logger->debug($message);
} }
} }

View File

@@ -34,119 +34,138 @@ class EntitiesBasketElementProxy extends \Entities\BasketElement implements \Doc
unset($this->_entityPersister, $this->_identifier); unset($this->_entityPersister, $this->_identifier);
} }
} }
public function getId() public function getId()
{ {
$this->__load(); $this->__load();
return parent::getId(); return parent::getId();
} }
public function setRecordId($recordId) public function setRecordId($recordId)
{ {
$this->__load(); $this->__load();
return parent::setRecordId($recordId); return parent::setRecordId($recordId);
} }
public function getRecordId() public function getRecordId()
{ {
$this->__load(); $this->__load();
return parent::getRecordId(); return parent::getRecordId();
} }
public function setSbasId($sbasId) public function setSbasId($sbasId)
{ {
$this->__load(); $this->__load();
return parent::setSbasId($sbasId); return parent::setSbasId($sbasId);
} }
public function getSbasId() public function getSbasId()
{ {
$this->__load(); $this->__load();
return parent::getSbasId(); return parent::getSbasId();
} }
public function setOrd($ord) public function setOrd($ord)
{ {
$this->__load(); $this->__load();
return parent::setOrd($ord); return parent::setOrd($ord);
} }
public function getOrd() public function getOrd()
{ {
$this->__load(); $this->__load();
return parent::getOrd(); return parent::getOrd();
} }
public function setCreated($created) public function setCreated($created)
{ {
$this->__load(); $this->__load();
return parent::setCreated($created); return parent::setCreated($created);
} }
public function getCreated() public function getCreated()
{ {
$this->__load(); $this->__load();
return parent::getCreated(); return parent::getCreated();
} }
public function setUpdated($updated) public function setUpdated($updated)
{ {
$this->__load(); $this->__load();
return parent::setUpdated($updated); return parent::setUpdated($updated);
} }
public function getUpdated() public function getUpdated()
{ {
$this->__load(); $this->__load();
return parent::getUpdated(); return parent::getUpdated();
} }
public function setBasket(\Entities\Basket $basket) public function setBasket(\Entities\Basket $basket)
{ {
$this->__load(); $this->__load();
return parent::setBasket($basket); return parent::setBasket($basket);
} }
public function getBasket() public function getBasket()
{ {
$this->__load(); $this->__load();
return parent::getBasket(); return parent::getBasket();
} }
public function getRecord() public function getRecord()
{ {
$this->__load(); $this->__load();
return parent::getRecord(); return parent::getRecord();
} }
public function setRecord(\record_adapter $record) public function setRecord(\record_adapter $record)
{ {
$this->__load(); $this->__load();
return parent::setRecord($record); return parent::setRecord($record);
} }
public function setLastInBasket() public function setLastInBasket()
{ {
$this->__load(); $this->__load();
return parent::setLastInBasket(); return parent::setLastInBasket();
} }
public function addValidationData(\Entities\ValidationData $validationDatas) public function addValidationData(\Entities\ValidationData $validationDatas)
{ {
$this->__load(); $this->__load();
return parent::addValidationData($validationDatas); return parent::addValidationData($validationDatas);
} }
public function getValidationDatas() public function getValidationDatas()
{ {
$this->__load(); $this->__load();
return parent::getValidationDatas(); return parent::getValidationDatas();
} }
public function getUserValidationDatas(\User_Adapter $user) public function getUserValidationDatas(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::getUserValidationDatas($user); return parent::getUserValidationDatas($user);
} }
@@ -170,6 +189,6 @@ class EntitiesBasketElementProxy extends \Entities\BasketElement implements \Doc
} }
unset($this->_entityPersister, $this->_identifier); unset($this->_entityPersister, $this->_identifier);
} }
} }
} }

View File

@@ -34,167 +34,194 @@ class EntitiesBasketProxy extends \Entities\Basket implements \Doctrine\ORM\Prox
unset($this->_entityPersister, $this->_identifier); unset($this->_entityPersister, $this->_identifier);
} }
} }
public function getId() public function getId()
{ {
$this->__load(); $this->__load();
return parent::getId(); return parent::getId();
} }
public function setName($name) public function setName($name)
{ {
$this->__load(); $this->__load();
return parent::setName($name); return parent::setName($name);
} }
public function getName() public function getName()
{ {
$this->__load(); $this->__load();
return parent::getName(); return parent::getName();
} }
public function setDescription($description) public function setDescription($description)
{ {
$this->__load(); $this->__load();
return parent::setDescription($description); return parent::setDescription($description);
} }
public function getDescription() public function getDescription()
{ {
$this->__load(); $this->__load();
return parent::getDescription(); return parent::getDescription();
} }
public function setUsrId($usrId) public function setUsrId($usrId)
{ {
$this->__load(); $this->__load();
return parent::setUsrId($usrId); return parent::setUsrId($usrId);
} }
public function getUsrId() public function getUsrId()
{ {
$this->__load(); $this->__load();
return parent::getUsrId(); return parent::getUsrId();
} }
public function setPusherId($pusherId) public function setPusherId($pusherId)
{ {
$this->__load(); $this->__load();
return parent::setPusherId($pusherId); return parent::setPusherId($pusherId);
} }
public function getPusherId() public function getPusherId()
{ {
$this->__load(); $this->__load();
return parent::getPusherId(); return parent::getPusherId();
} }
public function setArchived($archived) public function setArchived($archived)
{ {
$this->__load(); $this->__load();
return parent::setArchived($archived); return parent::setArchived($archived);
} }
public function getArchived() public function getArchived()
{ {
$this->__load(); $this->__load();
return parent::getArchived(); return parent::getArchived();
} }
public function setCreated($created) public function setCreated($created)
{ {
$this->__load(); $this->__load();
return parent::setCreated($created); return parent::setCreated($created);
} }
public function getCreated() public function getCreated()
{ {
$this->__load(); $this->__load();
return parent::getCreated(); return parent::getCreated();
} }
public function setUpdated($updated) public function setUpdated($updated)
{ {
$this->__load(); $this->__load();
return parent::setUpdated($updated); return parent::setUpdated($updated);
} }
public function getUpdated() public function getUpdated()
{ {
$this->__load(); $this->__load();
return parent::getUpdated(); return parent::getUpdated();
} }
public function addBasketElement(\Entities\BasketElement $elements) public function addBasketElement(\Entities\BasketElement $elements)
{ {
$this->__load(); $this->__load();
return parent::addBasketElement($elements); return parent::addBasketElement($elements);
} }
public function getElements() public function getElements()
{ {
$this->__load(); $this->__load();
return parent::getElements(); return parent::getElements();
} }
public function setPusher(\User_Adapter $user) public function setPusher(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::setPusher($user); return parent::setPusher($user);
} }
public function getPusher() public function getPusher()
{ {
$this->__load(); $this->__load();
return parent::getPusher(); return parent::getPusher();
} }
public function setOwner(\User_Adapter $user) public function setOwner(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::setOwner($user); return parent::setOwner($user);
} }
public function getOwner() public function getOwner()
{ {
$this->__load(); $this->__load();
return parent::getOwner(); return parent::getOwner();
} }
public function setValidation(\Entities\ValidationSession $validation) public function setValidation(\Entities\ValidationSession $validation)
{ {
$this->__load(); $this->__load();
return parent::setValidation($validation); return parent::setValidation($validation);
} }
public function getValidation() public function getValidation()
{ {
$this->__load(); $this->__load();
return parent::getValidation(); return parent::getValidation();
} }
public function setIsRead($isRead) public function setIsRead($isRead)
{ {
$this->__load(); $this->__load();
return parent::setIsRead($isRead); return parent::setIsRead($isRead);
} }
public function getIsRead() public function getIsRead()
{ {
$this->__load(); $this->__load();
return parent::getIsRead(); return parent::getIsRead();
} }
public function hasRecord(\record_adapter $record) public function hasRecord(\record_adapter $record)
{ {
$this->__load(); $this->__load();
return parent::hasRecord($record); return parent::hasRecord($record);
} }
public function getSize() public function getSize()
{ {
$this->__load(); $this->__load();
return parent::getSize(); return parent::getSize();
} }
@@ -218,6 +245,6 @@ class EntitiesBasketProxy extends \Entities\Basket implements \Doctrine\ORM\Prox
} }
unset($this->_entityPersister, $this->_identifier); unset($this->_entityPersister, $this->_identifier);
} }
} }
} }

View File

@@ -34,83 +34,96 @@ class EntitiesStoryWZProxy extends \Entities\StoryWZ implements \Doctrine\ORM\Pr
unset($this->_entityPersister, $this->_identifier); unset($this->_entityPersister, $this->_identifier);
} }
} }
public function getId() public function getId()
{ {
$this->__load(); $this->__load();
return parent::getId(); return parent::getId();
} }
public function setSbasId($sbasId) public function setSbasId($sbasId)
{ {
$this->__load(); $this->__load();
return parent::setSbasId($sbasId); return parent::setSbasId($sbasId);
} }
public function getSbasId() public function getSbasId()
{ {
$this->__load(); $this->__load();
return parent::getSbasId(); return parent::getSbasId();
} }
public function setRecordId($recordId) public function setRecordId($recordId)
{ {
$this->__load(); $this->__load();
return parent::setRecordId($recordId); return parent::setRecordId($recordId);
} }
public function getRecordId() public function getRecordId()
{ {
$this->__load(); $this->__load();
return parent::getRecordId(); return parent::getRecordId();
} }
public function setUsrId($usrId) public function setUsrId($usrId)
{ {
$this->__load(); $this->__load();
return parent::setUsrId($usrId); return parent::setUsrId($usrId);
} }
public function getUsrId() public function getUsrId()
{ {
$this->__load(); $this->__load();
return parent::getUsrId(); return parent::getUsrId();
} }
public function setCreated($created) public function setCreated($created)
{ {
$this->__load(); $this->__load();
return parent::setCreated($created); return parent::setCreated($created);
} }
public function getCreated() public function getCreated()
{ {
$this->__load(); $this->__load();
return parent::getCreated(); return parent::getCreated();
} }
public function setUser(\User_Adapter $user) public function setUser(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::setUser($user); return parent::setUser($user);
} }
public function getUser() public function getUser()
{ {
$this->__load(); $this->__load();
return parent::getUser(); return parent::getUser();
} }
public function getRecord() public function getRecord()
{ {
$this->__load(); $this->__load();
return parent::getRecord(); return parent::getRecord();
} }
public function setRecord(\record_adapter $record) public function setRecord(\record_adapter $record)
{ {
$this->__load(); $this->__load();
return parent::setRecord($record); return parent::setRecord($record);
} }
@@ -134,6 +147,6 @@ class EntitiesStoryWZProxy extends \Entities\StoryWZ implements \Doctrine\ORM\Pr
} }
unset($this->_entityPersister, $this->_identifier); unset($this->_entityPersister, $this->_identifier);
} }
} }
} }

View File

@@ -34,71 +34,82 @@ class EntitiesUsrListEntryProxy extends \Entities\UsrListEntry implements \Doctr
unset($this->_entityPersister, $this->_identifier); unset($this->_entityPersister, $this->_identifier);
} }
} }
public function getId() public function getId()
{ {
$this->__load(); $this->__load();
return parent::getId(); return parent::getId();
} }
public function setUsrId($usrId) public function setUsrId($usrId)
{ {
$this->__load(); $this->__load();
return parent::setUsrId($usrId); return parent::setUsrId($usrId);
} }
public function getUsrId() public function getUsrId()
{ {
$this->__load(); $this->__load();
return parent::getUsrId(); return parent::getUsrId();
} }
public function setCreated($created) public function setCreated($created)
{ {
$this->__load(); $this->__load();
return parent::setCreated($created); return parent::setCreated($created);
} }
public function getCreated() public function getCreated()
{ {
$this->__load(); $this->__load();
return parent::getCreated(); return parent::getCreated();
} }
public function setUpdated($updated) public function setUpdated($updated)
{ {
$this->__load(); $this->__load();
return parent::setUpdated($updated); return parent::setUpdated($updated);
} }
public function getUpdated() public function getUpdated()
{ {
$this->__load(); $this->__load();
return parent::getUpdated(); return parent::getUpdated();
} }
public function setList(\Entities\UsrList $list) public function setList(\Entities\UsrList $list)
{ {
$this->__load(); $this->__load();
return parent::setList($list); return parent::setList($list);
} }
public function getList() public function getList()
{ {
$this->__load(); $this->__load();
return parent::getList(); return parent::getList();
} }
public function getUser() public function getUser()
{ {
$this->__load(); $this->__load();
return parent::getUser(); return parent::getUser();
} }
public function setUser(\User_Adapter $user) public function setUser(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::setUser($user); return parent::setUser($user);
} }
@@ -122,6 +133,6 @@ class EntitiesUsrListEntryProxy extends \Entities\UsrListEntry implements \Doctr
} }
unset($this->_entityPersister, $this->_identifier); unset($this->_entityPersister, $this->_identifier);
} }
} }
} }

View File

@@ -34,83 +34,96 @@ class EntitiesUsrListOwnerProxy extends \Entities\UsrListOwner implements \Doctr
unset($this->_entityPersister, $this->_identifier); unset($this->_entityPersister, $this->_identifier);
} }
} }
public function getId() public function getId()
{ {
$this->__load(); $this->__load();
return parent::getId(); return parent::getId();
} }
public function setUsrId($usrId) public function setUsrId($usrId)
{ {
$this->__load(); $this->__load();
return parent::setUsrId($usrId); return parent::setUsrId($usrId);
} }
public function getUsrId() public function getUsrId()
{ {
$this->__load(); $this->__load();
return parent::getUsrId(); return parent::getUsrId();
} }
public function setRole($role) public function setRole($role)
{ {
$this->__load(); $this->__load();
return parent::setRole($role); return parent::setRole($role);
} }
public function getRole() public function getRole()
{ {
$this->__load(); $this->__load();
return parent::getRole(); return parent::getRole();
} }
public function setCreated($created) public function setCreated($created)
{ {
$this->__load(); $this->__load();
return parent::setCreated($created); return parent::setCreated($created);
} }
public function getCreated() public function getCreated()
{ {
$this->__load(); $this->__load();
return parent::getCreated(); return parent::getCreated();
} }
public function setUpdated($updated) public function setUpdated($updated)
{ {
$this->__load(); $this->__load();
return parent::setUpdated($updated); return parent::setUpdated($updated);
} }
public function getUpdated() public function getUpdated()
{ {
$this->__load(); $this->__load();
return parent::getUpdated(); return parent::getUpdated();
} }
public function setList(\Entities\UsrList $list) public function setList(\Entities\UsrList $list)
{ {
$this->__load(); $this->__load();
return parent::setList($list); return parent::setList($list);
} }
public function getList() public function getList()
{ {
$this->__load(); $this->__load();
return parent::getList(); return parent::getList();
} }
public function setUser(\User_Adapter $user) public function setUser(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::setUser($user); return parent::setUser($user);
} }
public function getUser() public function getUser()
{ {
$this->__load(); $this->__load();
return parent::getUser(); return parent::getUser();
} }
@@ -134,6 +147,6 @@ class EntitiesUsrListOwnerProxy extends \Entities\UsrListOwner implements \Doctr
} }
unset($this->_entityPersister, $this->_identifier); unset($this->_entityPersister, $this->_identifier);
} }
} }
} }

View File

@@ -34,83 +34,96 @@ class EntitiesUsrListProxy extends \Entities\UsrList implements \Doctrine\ORM\Pr
unset($this->_entityPersister, $this->_identifier); unset($this->_entityPersister, $this->_identifier);
} }
} }
public function getId() public function getId()
{ {
$this->__load(); $this->__load();
return parent::getId(); return parent::getId();
} }
public function setName($name) public function setName($name)
{ {
$this->__load(); $this->__load();
return parent::setName($name); return parent::setName($name);
} }
public function getName() public function getName()
{ {
$this->__load(); $this->__load();
return parent::getName(); return parent::getName();
} }
public function setCreated($created) public function setCreated($created)
{ {
$this->__load(); $this->__load();
return parent::setCreated($created); return parent::setCreated($created);
} }
public function getCreated() public function getCreated()
{ {
$this->__load(); $this->__load();
return parent::getCreated(); return parent::getCreated();
} }
public function setUpdated($updated) public function setUpdated($updated)
{ {
$this->__load(); $this->__load();
return parent::setUpdated($updated); return parent::setUpdated($updated);
} }
public function getUpdated() public function getUpdated()
{ {
$this->__load(); $this->__load();
return parent::getUpdated(); return parent::getUpdated();
} }
public function addUsrListOwner(\Entities\UsrListOwner $owners) public function addUsrListOwner(\Entities\UsrListOwner $owners)
{ {
$this->__load(); $this->__load();
return parent::addUsrListOwner($owners); return parent::addUsrListOwner($owners);
} }
public function getOwners() public function getOwners()
{ {
$this->__load(); $this->__load();
return parent::getOwners(); return parent::getOwners();
} }
public function hasAccess(\User_Adapter $user) public function hasAccess(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::hasAccess($user); return parent::hasAccess($user);
} }
public function getOwner(\User_Adapter $user) public function getOwner(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::getOwner($user); return parent::getOwner($user);
} }
public function addUsrListEntry(\Entities\UsrListEntry $entry) public function addUsrListEntry(\Entities\UsrListEntry $entry)
{ {
$this->__load(); $this->__load();
return parent::addUsrListEntry($entry); return parent::addUsrListEntry($entry);
} }
public function getEntries() public function getEntries()
{ {
$this->__load(); $this->__load();
return parent::getEntries(); return parent::getEntries();
} }
@@ -134,6 +147,6 @@ class EntitiesUsrListProxy extends \Entities\UsrList implements \Doctrine\ORM\Pr
} }
unset($this->_entityPersister, $this->_identifier); unset($this->_entityPersister, $this->_identifier);
} }
} }
} }

View File

@@ -34,71 +34,82 @@ class EntitiesValidationDataProxy extends \Entities\ValidationData implements \D
unset($this->_entityPersister, $this->_identifier); unset($this->_entityPersister, $this->_identifier);
} }
} }
public function getId() public function getId()
{ {
$this->__load(); $this->__load();
return parent::getId(); return parent::getId();
} }
public function setAgreement($agreement) public function setAgreement($agreement)
{ {
$this->__load(); $this->__load();
return parent::setAgreement($agreement); return parent::setAgreement($agreement);
} }
public function getAgreement() public function getAgreement()
{ {
$this->__load(); $this->__load();
return parent::getAgreement(); return parent::getAgreement();
} }
public function setNote($note) public function setNote($note)
{ {
$this->__load(); $this->__load();
return parent::setNote($note); return parent::setNote($note);
} }
public function getNote() public function getNote()
{ {
$this->__load(); $this->__load();
return parent::getNote(); return parent::getNote();
} }
public function setUpdated($updated) public function setUpdated($updated)
{ {
$this->__load(); $this->__load();
return parent::setUpdated($updated); return parent::setUpdated($updated);
} }
public function getUpdated() public function getUpdated()
{ {
$this->__load(); $this->__load();
return parent::getUpdated(); return parent::getUpdated();
} }
public function setParticipant(\Entities\ValidationParticipant $participant) public function setParticipant(\Entities\ValidationParticipant $participant)
{ {
$this->__load(); $this->__load();
return parent::setParticipant($participant); return parent::setParticipant($participant);
} }
public function getParticipant() public function getParticipant()
{ {
$this->__load(); $this->__load();
return parent::getParticipant(); return parent::getParticipant();
} }
public function setBasketElement(\Entities\BasketElement $basketElement) public function setBasketElement(\Entities\BasketElement $basketElement)
{ {
$this->__load(); $this->__load();
return parent::setBasketElement($basketElement); return parent::setBasketElement($basketElement);
} }
public function getBasketElement() public function getBasketElement()
{ {
$this->__load(); $this->__load();
return parent::getBasketElement(); return parent::getBasketElement();
} }
@@ -122,6 +133,6 @@ class EntitiesValidationDataProxy extends \Entities\ValidationData implements \D
} }
unset($this->_entityPersister, $this->_identifier); unset($this->_entityPersister, $this->_identifier);
} }
} }
} }

View File

@@ -34,125 +34,145 @@ class EntitiesValidationParticipantProxy extends \Entities\ValidationParticipant
unset($this->_entityPersister, $this->_identifier); unset($this->_entityPersister, $this->_identifier);
} }
} }
public function getId() public function getId()
{ {
$this->__load(); $this->__load();
return parent::getId(); return parent::getId();
} }
public function setUsrId($usrId) public function setUsrId($usrId)
{ {
$this->__load(); $this->__load();
return parent::setUsrId($usrId); return parent::setUsrId($usrId);
} }
public function getUsrId() public function getUsrId()
{ {
$this->__load(); $this->__load();
return parent::getUsrId(); return parent::getUsrId();
} }
public function addValidationData(\Entities\ValidationData $datas) public function addValidationData(\Entities\ValidationData $datas)
{ {
$this->__load(); $this->__load();
return parent::addValidationData($datas); return parent::addValidationData($datas);
} }
public function setSession(\Entities\ValidationSession $session) public function setSession(\Entities\ValidationSession $session)
{ {
$this->__load(); $this->__load();
return parent::setSession($session); return parent::setSession($session);
} }
public function getSession() public function getSession()
{ {
$this->__load(); $this->__load();
return parent::getSession(); return parent::getSession();
} }
public function setIsAware($isAware) public function setIsAware($isAware)
{ {
$this->__load(); $this->__load();
return parent::setIsAware($isAware); return parent::setIsAware($isAware);
} }
public function getIsAware() public function getIsAware()
{ {
$this->__load(); $this->__load();
return parent::getIsAware(); return parent::getIsAware();
} }
public function setUser(\User_Adapter $user) public function setUser(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::setUser($user); return parent::setUser($user);
} }
public function getUser() public function getUser()
{ {
$this->__load(); $this->__load();
return parent::getUser(); return parent::getUser();
} }
public function setReminded($reminded) public function setReminded($reminded)
{ {
$this->__load(); $this->__load();
return parent::setReminded($reminded); return parent::setReminded($reminded);
} }
public function getReminded() public function getReminded()
{ {
$this->__load(); $this->__load();
return parent::getReminded(); return parent::getReminded();
} }
public function getDatas() public function getDatas()
{ {
$this->__load(); $this->__load();
return parent::getDatas(); return parent::getDatas();
} }
public function setIsConfirmed($isConfirmed) public function setIsConfirmed($isConfirmed)
{ {
$this->__load(); $this->__load();
return parent::setIsConfirmed($isConfirmed); return parent::setIsConfirmed($isConfirmed);
} }
public function getIsConfirmed() public function getIsConfirmed()
{ {
$this->__load(); $this->__load();
return parent::getIsConfirmed(); return parent::getIsConfirmed();
} }
public function setCanAgree($canAgree) public function setCanAgree($canAgree)
{ {
$this->__load(); $this->__load();
return parent::setCanAgree($canAgree); return parent::setCanAgree($canAgree);
} }
public function getCanAgree() public function getCanAgree()
{ {
$this->__load(); $this->__load();
return parent::getCanAgree(); return parent::getCanAgree();
} }
public function setCanSeeOthers($canSeeOthers) public function setCanSeeOthers($canSeeOthers)
{ {
$this->__load(); $this->__load();
return parent::setCanSeeOthers($canSeeOthers); return parent::setCanSeeOthers($canSeeOthers);
} }
public function getCanSeeOthers() public function getCanSeeOthers()
{ {
$this->__load(); $this->__load();
return parent::getCanSeeOthers(); return parent::getCanSeeOthers();
} }
public function isReleasable() public function isReleasable()
{ {
$this->__load(); $this->__load();
return parent::isReleasable(); return parent::isReleasable();
} }
@@ -176,6 +196,6 @@ class EntitiesValidationParticipantProxy extends \Entities\ValidationParticipant
} }
unset($this->_entityPersister, $this->_identifier); unset($this->_entityPersister, $this->_identifier);
} }
} }
} }

View File

@@ -34,167 +34,194 @@ class EntitiesValidationSessionProxy extends \Entities\ValidationSession impleme
unset($this->_entityPersister, $this->_identifier); unset($this->_entityPersister, $this->_identifier);
} }
} }
public function getId() public function getId()
{ {
$this->__load(); $this->__load();
return parent::getId(); return parent::getId();
} }
public function setName($name) public function setName($name)
{ {
$this->__load(); $this->__load();
return parent::setName($name); return parent::setName($name);
} }
public function getName() public function getName()
{ {
$this->__load(); $this->__load();
return parent::getName(); return parent::getName();
} }
public function setDescription($description) public function setDescription($description)
{ {
$this->__load(); $this->__load();
return parent::setDescription($description); return parent::setDescription($description);
} }
public function getDescription() public function getDescription()
{ {
$this->__load(); $this->__load();
return parent::getDescription(); return parent::getDescription();
} }
public function setArchived($archived) public function setArchived($archived)
{ {
$this->__load(); $this->__load();
return parent::setArchived($archived); return parent::setArchived($archived);
} }
public function getArchived() public function getArchived()
{ {
$this->__load(); $this->__load();
return parent::getArchived(); return parent::getArchived();
} }
public function setCreated($created) public function setCreated($created)
{ {
$this->__load(); $this->__load();
return parent::setCreated($created); return parent::setCreated($created);
} }
public function getCreated() public function getCreated()
{ {
$this->__load(); $this->__load();
return parent::getCreated(); return parent::getCreated();
} }
public function setUpdated($updated) public function setUpdated($updated)
{ {
$this->__load(); $this->__load();
return parent::setUpdated($updated); return parent::setUpdated($updated);
} }
public function getUpdated() public function getUpdated()
{ {
$this->__load(); $this->__load();
return parent::getUpdated(); return parent::getUpdated();
} }
public function setExpires($expires) public function setExpires($expires)
{ {
$this->__load(); $this->__load();
return parent::setExpires($expires); return parent::setExpires($expires);
} }
public function getExpires() public function getExpires()
{ {
$this->__load(); $this->__load();
return parent::getExpires(); return parent::getExpires();
} }
public function setReminded($reminded) public function setReminded($reminded)
{ {
$this->__load(); $this->__load();
return parent::setReminded($reminded); return parent::setReminded($reminded);
} }
public function getReminded() public function getReminded()
{ {
$this->__load(); $this->__load();
return parent::getReminded(); return parent::getReminded();
} }
public function setBasket(\Entities\Basket $basket) public function setBasket(\Entities\Basket $basket)
{ {
$this->__load(); $this->__load();
return parent::setBasket($basket); return parent::setBasket($basket);
} }
public function getBasket() public function getBasket()
{ {
$this->__load(); $this->__load();
return parent::getBasket(); return parent::getBasket();
} }
public function addValidationParticipant(\Entities\ValidationParticipant $participants) public function addValidationParticipant(\Entities\ValidationParticipant $participants)
{ {
$this->__load(); $this->__load();
return parent::addValidationParticipant($participants); return parent::addValidationParticipant($participants);
} }
public function getParticipants() public function getParticipants()
{ {
$this->__load(); $this->__load();
return parent::getParticipants(); return parent::getParticipants();
} }
public function getParticipant(\User_Adapter $user) public function getParticipant(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::getParticipant($user); return parent::getParticipant($user);
} }
public function setInitiatorId($initiatorId) public function setInitiatorId($initiatorId)
{ {
$this->__load(); $this->__load();
return parent::setInitiatorId($initiatorId); return parent::setInitiatorId($initiatorId);
} }
public function getInitiatorId() public function getInitiatorId()
{ {
$this->__load(); $this->__load();
return parent::getInitiatorId(); return parent::getInitiatorId();
} }
public function isInitiator(\User_Adapter $user) public function isInitiator(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::isInitiator($user); return parent::isInitiator($user);
} }
public function setInitiator(\User_Adapter $user) public function setInitiator(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::setInitiator($user); return parent::setInitiator($user);
} }
public function getInitiator() public function getInitiator()
{ {
$this->__load(); $this->__load();
return parent::getInitiator(); return parent::getInitiator();
} }
public function isFinished() public function isFinished()
{ {
$this->__load(); $this->__load();
return parent::isFinished(); return parent::isFinished();
} }
public function getValidationString(\User_Adapter $user) public function getValidationString(\User_Adapter $user)
{ {
$this->__load(); $this->__load();
return parent::getValidationString($user); return parent::getValidationString($user);
} }
@@ -218,6 +245,6 @@ class EntitiesValidationSessionProxy extends \Entities\ValidationSession impleme
} }
unset($this->_entityPersister, $this->_identifier); unset($this->_entityPersister, $this->_identifier);
} }
} }
} }

View File

@@ -15,7 +15,7 @@ class BasketElementRepository extends EntityRepository
public function findUserElement($element_id, \User_Adapter $user) public function findUserElement($element_id, \User_Adapter $user)
{ {
$dql = 'SELECT e FROM Entities\BasketElement e $dql = 'SELECT e FROM Entities\BasketElement e
JOIN e.basket b JOIN e.basket b
WHERE b.usr_id = :usr_id AND e.id = :element_id'; WHERE b.usr_id = :usr_id AND e.id = :element_id';
@@ -29,10 +29,10 @@ class BasketElementRepository extends EntityRepository
return $query->getOneOrNullResult(); return $query->getOneOrNullResult();
} }
public function findElementsByRecord(\record_adapter $record) public function findElementsByRecord(\record_adapter $record)
{ {
$dql = 'SELECT e FROM Entities\BasketElement e $dql = 'SELECT e FROM Entities\BasketElement e
WHERE e.record_id = :record_id AND e.sbas_id = :sbas_id'; WHERE e.record_id = :record_id AND e.sbas_id = :sbas_id';
$params = array( $params = array(
@@ -45,7 +45,7 @@ class BasketElementRepository extends EntityRepository
return $query->getResult(); return $query->getResult();
} }
/** /**
* *
* @param \record_adapter $record * @param \record_adapter $record
@@ -54,9 +54,9 @@ class BasketElementRepository extends EntityRepository
*/ */
public function findReceivedElementsByRecord(\record_adapter $record, \User_Adapter $user) public function findReceivedElementsByRecord(\record_adapter $record, \User_Adapter $user)
{ {
$dql = 'SELECT e FROM Entities\BasketElement e $dql = 'SELECT e FROM Entities\BasketElement e
JOIN e.basket b JOIN e.basket b
WHERE b.usr_id = :usr_id AND b.pusher_id IS NOT NULL WHERE b.usr_id = :usr_id AND b.pusher_id IS NOT NULL
AND e.record_id = :record_id AND e.sbas_id = :sbas_id'; AND e.record_id = :record_id AND e.sbas_id = :sbas_id';
$params = array( $params = array(
@@ -70,14 +70,14 @@ class BasketElementRepository extends EntityRepository
return $query->getResult(); return $query->getResult();
} }
public function findReceivedValidationElementsByRecord(\record_adapter $record, \User_Adapter $user) public function findReceivedValidationElementsByRecord(\record_adapter $record, \User_Adapter $user)
{ {
$dql = 'SELECT e FROM Entities\BasketElement e $dql = 'SELECT e FROM Entities\BasketElement e
JOIN e.basket b JOIN e.basket b
JOIN b.validation v JOIN b.validation v
JOIN v.participants p JOIN v.participants p
WHERE p.usr_id = :usr_id WHERE p.usr_id = :usr_id
AND e.record_id = :record_id AND e.sbas_id = :sbas_id'; AND e.record_id = :record_id AND e.sbas_id = :sbas_id';
$params = array( $params = array(
@@ -91,12 +91,12 @@ class BasketElementRepository extends EntityRepository
return $query->getResult(); return $query->getResult();
} }
/** /**
* *
* @param type $element_id * @param type $element_id
* @param \User_Adapter $user * @param \User_Adapter $user
* @return \Entities\BasketELement * @return \Entities\BasketELement
*/ */
public function findElement($element_id, \User_Adapter $user) public function findElement($element_id, \User_Adapter $user)
{ {
@@ -116,4 +116,4 @@ class BasketElementRepository extends EntityRepository
return $element; return $element;
} }
} }

View File

@@ -32,11 +32,11 @@ class BasketRepository extends EntityRepository
* Returns all basket for a given user that are not marked as archived * Returns all basket for a given user that are not marked as archived
* *
* @param \User_Adapter $user * @param \User_Adapter $user
* @return \Doctrine\Common\Collections\ArrayCollection * @return \Doctrine\Common\Collections\ArrayCollection
*/ */
public function findActiveByUser(\User_Adapter $user) public function findActiveByUser(\User_Adapter $user)
{ {
$dql = 'SELECT b FROM Entities\Basket b $dql = 'SELECT b FROM Entities\Basket b
WHERE b.usr_id = :usr_id AND b.archived = false'; WHERE b.usr_id = :usr_id AND b.archived = false';
$query = $this->_em->createQuery($dql); $query = $this->_em->createQuery($dql);
@@ -49,12 +49,12 @@ class BasketRepository extends EntityRepository
* Returns all unread basket for a given user that are not marked as archived * Returns all unread basket for a given user that are not marked as archived
* *
* @param \User_Adapter $user * @param \User_Adapter $user
* @return \Doctrine\Common\Collections\ArrayCollection * @return \Doctrine\Common\Collections\ArrayCollection
*/ */
public function findUnreadActiveByUser(\User_Adapter $user) public function findUnreadActiveByUser(\User_Adapter $user)
{ {
$dql = 'SELECT b FROM Entities\Basket b $dql = 'SELECT b FROM Entities\Basket b
WHERE b.usr_id = :usr_id WHERE b.usr_id = :usr_id
AND b.archived = false AND b.is_read = false'; AND b.archived = false AND b.is_read = false';
$query = $this->_em->createQuery($dql); $query = $this->_em->createQuery($dql);
@@ -64,18 +64,18 @@ class BasketRepository extends EntityRepository
} }
/** /**
* Returns all baskets that are in validation session not expired and * Returns all baskets that are in validation session not expired and
* where a specified user is participant (not owner) * where a specified user is participant (not owner)
* *
* @param \User_Adapter $user * @param \User_Adapter $user
* @return \Doctrine\Common\Collections\ArrayCollection * @return \Doctrine\Common\Collections\ArrayCollection
*/ */
public function findActiveValidationByUser(\User_Adapter $user) public function findActiveValidationByUser(\User_Adapter $user)
{ {
$dql = 'SELECT b FROM Entities\Basket b $dql = 'SELECT b FROM Entities\Basket b
JOIN b.validation s JOIN b.validation s
JOIN s.participants p JOIN s.participants p
WHERE b.usr_id != ?1 AND p.usr_id = ?2 WHERE b.usr_id != ?1 AND p.usr_id = ?2
AND s.expires > CURRENT_TIMESTAMP()'; AND s.expires > CURRENT_TIMESTAMP()';
$query = $this->_em->createQuery($dql); $query = $this->_em->createQuery($dql);
@@ -91,7 +91,7 @@ class BasketRepository extends EntityRepository
* @throws \Exception_Forbidden * @throws \Exception_Forbidden
* @param type $basket_id * @param type $basket_id
* @param \User_Adapter $user * @param \User_Adapter $user
* @return \Entities\Basket * @return \Entities\Basket
*/ */
public function findUserBasket($basket_id, \User_Adapter $user) public function findUserBasket($basket_id, \User_Adapter $user)
{ {
@@ -114,8 +114,8 @@ class BasketRepository extends EntityRepository
public function findContainingRecord(\record_adapter $record) public function findContainingRecord(\record_adapter $record)
{ {
$dql = 'SELECT b FROM Entities\Basket b $dql = 'SELECT b FROM Entities\Basket b
JOIN b.elements e JOIN b.elements e
WHERE e.record_id = :record_id AND e.sbas_id = e.sbas_id'; WHERE e.record_id = :record_id AND e.sbas_id = e.sbas_id';
$params = array( $params = array(
@@ -135,16 +135,16 @@ class BasketRepository extends EntityRepository
switch ($type) switch ($type)
{ {
case self::RECEIVED: case self::RECEIVED:
$dql = 'SELECT b FROM Entities\Basket b $dql = 'SELECT b FROM Entities\Basket b
WHERE b.usr_id = :usr_id AND b.pusher_id IS NOT NULL'; WHERE b.usr_id = :usr_id AND b.pusher_id IS NOT NULL';
$params = array( $params = array(
'usr_id' => $user->get_id() 'usr_id' => $user->get_id()
); );
break; break;
case self::VALIDATION_DONE: case self::VALIDATION_DONE:
$dql = 'SELECT b FROM Entities\Basket b $dql = 'SELECT b FROM Entities\Basket b
JOIN b.validation s JOIN b.validation s
JOIN s.participants p JOIN s.participants p
WHERE b.usr_id != ?1 AND p.usr_id = ?2'; WHERE b.usr_id != ?1 AND p.usr_id = ?2';
$params = array( $params = array(
1 => $user->get_id() 1 => $user->get_id()
@@ -152,7 +152,7 @@ class BasketRepository extends EntityRepository
); );
break; break;
case self::VALIDATION_SENT: case self::VALIDATION_SENT:
$dql = 'SELECT b FROM Entities\Basket b $dql = 'SELECT b FROM Entities\Basket b
JOIN b.validation v JOIN b.validation v
WHERE b.usr_id = :usr_id'; WHERE b.usr_id = :usr_id';
$params = array( $params = array(
@@ -160,8 +160,8 @@ class BasketRepository extends EntityRepository
); );
break; break;
default: default:
$dql = 'SELECT b FROM Entities\Basket b $dql = 'SELECT b FROM Entities\Basket b
LEFT JOIN b.validation s LEFT JOIN s.participants p LEFT JOIN b.validation s LEFT JOIN s.participants p
WHERE (b.usr_id = :usr_id OR p.usr_id = :validating_usr_id)'; WHERE (b.usr_id = :usr_id OR p.usr_id = :validating_usr_id)';
$params = array( $params = array(
'usr_id' => $user->get_id(), 'usr_id' => $user->get_id(),
@@ -169,19 +169,19 @@ class BasketRepository extends EntityRepository
); );
break; break;
} }
if (ctype_digit($year) && strlen($year) == 4) if (ctype_digit($year) && strlen($year) == 4)
{ {
$dql .= ' AND b.created >= :min_date AND b.created <= :max_date '; $dql .= ' AND b.created >= :min_date AND b.created <= :max_date ';
$params['min_date'] = sprintf('%d-01-01 00:00:00', $year); $params['min_date'] = sprintf('%d-01-01 00:00:00', $year);
$params['max_date'] = sprintf('%d-12-31 23:59:59', $year); $params['max_date'] = sprintf('%d-12-31 23:59:59', $year);
} }
if (trim($query) !== '') if (trim($query) !== '')
{ {
$dql .= ' AND (b.name LIKE :name OR b.description LIKE :description) '; $dql .= ' AND (b.name LIKE :name OR b.description LIKE :description) ';
$params['name'] = '%'.$query.'%'; $params['name'] = '%'.$query.'%';
$params['description'] = '%'.$query.'%'; $params['description'] = '%'.$query.'%';
} }

View File

@@ -12,4 +12,4 @@ use Doctrine\ORM\EntityRepository;
*/ */
class BasketElementRepository extends EntityRepository class BasketElementRepository extends EntityRepository
{ {
} }

View File

@@ -12,4 +12,4 @@ use Doctrine\ORM\EntityRepository;
*/ */
class BasketRepository extends EntityRepository class BasketRepository extends EntityRepository
{ {
} }

View File

@@ -12,4 +12,4 @@ use Doctrine\ORM\EntityRepository;
*/ */
class StoryWZRepository extends EntityRepository class StoryWZRepository extends EntityRepository
{ {
} }

Some files were not shown because too many files have changed in this diff Show More