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

View File

@@ -11,12 +11,12 @@ twig:
debug: false
#The charset used by the templates
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)
strict_variables: true
#Optimize the node tree before compilation
optimizer: true
twig_debug:
type: twig
options:
@@ -25,7 +25,7 @@ twig_debug:
strict_variables: true
autoescape: true
optimizer: true
#Doctrine developement service options
#Service name
doctrine_dev:
@@ -47,15 +47,15 @@ doctrine_dev:
query: array_cache
result: array_cache
metadata: array_cache
# Assign a service to log doctrine queries
# Assign a service to log doctrine queries
log: query_logger
# Doctrine test service options
doctrine_test:
type: doctrine
options:
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
orm:
cache:
@@ -63,7 +63,7 @@ doctrine_test:
result: array_cache
metadata: array_cache
log: query_logger
# Doctrine production service options
doctrine_prod:
type: doctrine
@@ -76,15 +76,15 @@ doctrine_prod:
result: apc_cache
metadata: apc_cache
log: query_logger
# Define a Log service
# This one is defined to handle the logs of doctrine queries
# Only Monolog is available as a logger service
# 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
query_logger:
type: monolog
type: monolog
options:
#You can precise the output format
#This option is only available when log are used to log doctrine queries
@@ -97,34 +97,34 @@ query_logger:
channel: query-logger
#Define how the logs will be handled
#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
#Stream handler is used to stores logs in a single local file
handler: rotate
max_day: 2
#Name of the file where logs are written
filename: doctrine-query.log
# Define a phpecho log service for Doctrine
# phpecho logger logs doctrine queries to the standard output using echo/var_dump
# Notice that phpecho logger do not have options
sql_logger:
type: phpecho
#Define cache services
#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
array_cache:
type: array
memcache_cache:
type: memcache
options:
host: localhost
port: 11211
apc_cache:
type: apc
xcache_cache:
type: xcache
type: xcache

View File

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

View File

@@ -44,7 +44,7 @@ return call_user_func(function()
$app['p4user'] = null;
/**
* @var API_OAuth2_Token
* @var API_OAuth2_Token
*/
$app['token'] = null;
@@ -123,6 +123,7 @@ return call_user_func(function()
}
}
}
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());
if ($session->is_authenticated())
return;
if ($oauth2_adapter->has_ses_id())
{
@@ -152,7 +154,7 @@ return call_user_func(function()
}
catch (\Exception $e)
{
}
}
$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']);
return $app;
});
});

View File

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

View File

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

View File

@@ -71,7 +71,7 @@ return call_user_func(
}
catch (\Exception $e)
{
}
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/error.twig', $params), 200);
}
if ($request->getRequestFormat() == 'json')
@@ -114,4 +115,4 @@ return call_user_func(function()
return $app;
});
});

View File

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

View File

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

View File

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

View File

@@ -37,7 +37,7 @@ class Fields implements ControllerProviderInterface
$controllers->get('/checkmulti/', function() use ($app, $appbox)
{
$request = $app['request'];
$multi = ($request->get('multi') === 'true');
$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);
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'));
$request = $app['request'];
@@ -116,6 +117,7 @@ class Publications implements ControllerProviderInterface
$user = \User_Adapter::getInstance($appbox->get_session()->get_usr_id(), $appbox);
if (!$feed->is_owner($user))
return new Response('ERROR:you are not allowed');
$request = $app["request"];
@@ -123,20 +125,25 @@ class Publications implements ControllerProviderInterface
$fileData = $request->files->get("Filedata");
if ($fileData['error'] !== 0)
return new Response('ERROR:error while upload');
$file = new \system_file($fileData['tmp_name']);
if (!in_array($file->get_mime(), array('image/jpeg', 'image/jpg', 'image/gif')))
return new Response('ERROR:bad filetype');
if ($file->getSize() > 200000)
return new Response('ERROR:file too large');
$datas = $file->get_technical_datas();
if (!isset($datas[\system_file::TC_DATAS_WIDTH]) || !isset($datas[\system_file::TC_DATAS_HEIGHT]))
return new Response('ERROR:file is not square');
if ($datas[\system_file::TC_DATAS_WIDTH] != $datas[\system_file::TC_DATAS_HEIGHT])
return new Response('ERROR:file is not square');
$feed->set_icon($file);

View File

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

View File

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

View File

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

View File

@@ -37,13 +37,13 @@ class Basket implements ControllerProviderInterface
/**
* This route is used to create a Basket
*
*
* @params name : title (mandatory)
* @params desc : description (optionnal)
* @params lst : Phraseanet serialized record list (optionnal)
*
*
* @accept JSON / YAML
*
*
*/
$controllers->post('/', function(Application $app)
{
@@ -119,9 +119,9 @@ class Basket implements ControllerProviderInterface
/**
* This route is used to delete a basket
*
*
* @accept JSON / HTML
*
*
*/
$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(
'/{basket_id}/delete/{basket_element_id}/'
@@ -194,10 +194,10 @@ class Basket implements ControllerProviderInterface
/**
* Update name and description of a basket
*
*
* @param name string mandatory
* @param description string optionnal
*
*
*/
$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(
'/{basket_id}/reorder/'
@@ -280,10 +280,10 @@ class Basket implements ControllerProviderInterface
/**
* Toggle the status of a Basket
*
*
* @param acrhive : 0|1 (mandatory)
*
* @returns JSON / HTML
*
* @returns JSON / HTML
*/
$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');
}
$data = array(
'success' => true
, 'archive' => $archive_status
@@ -399,11 +399,11 @@ class Basket implements ControllerProviderInterface
/**
*
*
* Move Basket element from a basket to another
*
*
* @params elements Array : list of basket element id
*
*
*/
$controllers->post(
'/{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)
{
@@ -470,7 +470,7 @@ class Basket implements ControllerProviderInterface
});
/**
* Get a basket
* Get a basket
*/
$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)
{
$datas = array('success'=>false, 'message'=>'', 'results'=>array());
$Serializer = $app['Core']['Serializer'];
$sbas_id = (int) $request->get('sbas_id');
try
{
$VC = \Alchemy\Phrasea\Vocabulary\Controller::get($vocabulary);
@@ -62,17 +62,17 @@ class Edit implements ControllerProviderInterface
catch(\Exception $e)
{
$datas['message'] = _('Vocabulary not found');
$datas = $Serializer->serialize($datas, 'json');
return new response($datas, 200, array('Content-Type'=>'application/json'));
}
$query = $request->get('query');
$datas['success'] = true;
$datas['results'] = $VC->find($query, $app['Core']->getAuthenticatedUser(), $databox);
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;
}
}
}

View File

@@ -62,6 +62,7 @@ class Printer implements ControllerProviderInterface
->log($record, \Session_Logger::EVENT_PRINT, $layout, '');
}
$PDF = new PDFExport($printer->get_elements(), $layout);
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)
{
}
$Participant = new \Entities\ValidationParticipant();
@@ -335,7 +335,7 @@ class Push implements ControllerProviderInterface
->like(\User_Query::LIKE_LASTNAME, $request->get('query'))
->like(\User_Query::LIKE_LOGIN, $request->get('query'))
->like_match(\User_Query::LIKE_MATCH_OR);
$result = $query->include_phantoms()
->limit(0, 50)
->execute()->get_results();

View File

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

View File

@@ -105,7 +105,7 @@ class Story implements ControllerProviderInterface
'record_id' => $Story->get_record_id(),
)
);
$datas = $app['Core']['Serializer']->serialize($data, '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);
$search_engine = null;
if (($search_engine_options = unserialize($app['request']->get('options_serial'))) !== false)
{
$search_engine = new \searchEngine_adapter($app['appbox']->get_registry());
$search_engine->set_options($search_engine_options);
}
/* @var $twig \Twig_Environment */
$twig = $app['Core']->getTwig();
@@ -200,4 +200,4 @@ class Tooltip implements ControllerProviderInterface
return $controllers;
}
}
}

View File

@@ -98,9 +98,9 @@ class UsrLists implements ControllerProviderInterface
$controllers->post('/list/', function(Application $app)
{
$request = $app['request'];
$list_name = $request->get('name');
$datas = array(
'success' => false
, 'message' => sprintf(_('Unable to create list %s'), $list_name)
@@ -112,7 +112,7 @@ class UsrLists implements ControllerProviderInterface
{
throw new ControllerException(_('List name is required'));
}
$em = $app['Core']->getEntityManager();
$List = new \Entities\UsrList();
@@ -159,7 +159,7 @@ class UsrLists implements ControllerProviderInterface
$repository = $em->getRepository('\Entities\UsrList');
$list = $repository->findUserListByUserAndId($user, $list_id);
$owners = $entries = $lists = array();
foreach ($list->getOwners() as $owner)
@@ -215,16 +215,16 @@ class UsrLists implements ControllerProviderInterface
'success' => false
, 'message' => _('Unable to update list')
);
try
{
$list_name = $request->get('name');
if(!$list_name)
{
throw new ControllerException(_('List name is required'));
}
$user = $app['Core']->getAuthenticatedUser();
$em = $app['Core']->getEntityManager();
@@ -266,9 +266,9 @@ class UsrLists implements ControllerProviderInterface
try
{
$repository = $em->getRepository('\Entities\UsrList');
$user = $app['Core']->getAuthenticatedUser();
$list = $repository->findUserListByUserAndId($user, $list_id);
$em->remove($list);
@@ -305,19 +305,19 @@ class UsrLists implements ControllerProviderInterface
try
{
$repository = $em->getRepository('\Entities\UsrList');
$user = $app['Core']->getAuthenticatedUser();
$list = $repository->findUserListByUserAndId($user, $list_id);
/* @var $list \Entities\UsrList */
$entry_repository = $em->getRepository('\Entities\UsrListEntry');
$user_entry = $entry_repository->findEntryByListAndEntryId($list, $entry_id);
$em->remove($user_entry);
$em->flush();
$datas = array(
'success' => true
, 'message' => _('Entry removed from list')
@@ -345,7 +345,7 @@ class UsrLists implements ControllerProviderInterface
{
$em = $app['Core']->getEntityManager();
$user = $app['Core']->getAuthenticatedUser();
try
{
$repository = $em->getRepository('\Entities\UsrList');
@@ -399,14 +399,14 @@ class UsrLists implements ControllerProviderInterface
$list = $repository->findUserListByUserAndId($user, $list_id);
/* @var $list \Entities\UsrList */
if($list->getOwner($user)->getRole() < \Entities\UsrListOwner::ROLE_EDITOR)
{
throw new \Exception('You are not authorized to do this');
}
$new_owner = \User_Adapter::getInstance($usr_id, \appbox::get_instance());
if($list->hasAccess($new_owner))
{
$owner = $list->getOwner($new_owner);
@@ -416,20 +416,20 @@ class UsrLists implements ControllerProviderInterface
$owner = new \Entities\UsrListOwner();
$owner->setList($list);
$owner->setUser($new_owner);
$list->addUsrListOwner($owner);
$em->persist($owner);
$em->merge($list);
}
$role = $app['request']->get('role', \Entities\UsrListOwner::ROLE_USER);
$owner->setRole($role);
$em->merge($owner);
$em->flush();
$datas = array(
'success' => true
, 'message' => _('List shared to user')
@@ -437,20 +437,20 @@ class UsrLists implements ControllerProviderInterface
}
catch (\Exception $e)
{
$datas = array(
'success' => false
, 'message' => _('Unable to share the list with the usr')
);
}
$Json = $app['Core']['Serializer']->serialize($datas, '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)
{
@@ -463,19 +463,19 @@ class UsrLists implements ControllerProviderInterface
$list = $repository->findUserListByUserAndId($user, $list_id);
/* @var $list \Entities\UsrList */
if($list->getOwner($user)->getList() < \Entities\UsrListOwner::ROLE_ADMIN)
{
throw new \Exception('You are not authorized to do this');
}
$owners_repository = $em->getRepository('\Entities\UsrListOwner');
$owner = $owners_repository->findByListAndOwner($list, $owner_id);
$em->remove($owner);
$em->flush();
$datas = array(
'success' => true
, 'message' => _('Owner removed from list')
@@ -489,7 +489,7 @@ class UsrLists implements ControllerProviderInterface
, 'message' => _('Unable to add usr to list')
);
}
$Json = $app['Core']['Serializer']->serialize($datas, '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)
{
$date_obj = new \DateTime();
$params = array(
'CurrentYear' => $date_obj->format('Y')
);
return new Response(
$app['Core']->getTwig()->render('prod/WorkZone/Browser/Browser.html.twig'
, $params
@@ -76,10 +76,10 @@ class WorkZone implements ControllerProviderInterface
$BasketRepo = $em->getRepository('\Entities\Basket');
$Page = (int) $request->get('Page', 0);
$PerPage = 10;
$offsetStart = max(($Page - 1) * $PerPage, 0);
$Baskets = $BasketRepo->findWorkzoneBasket(
$user
@@ -106,7 +106,7 @@ class WorkZone implements ControllerProviderInterface
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)
{
@@ -114,7 +114,7 @@ class WorkZone implements ControllerProviderInterface
$basket = $em->getRepository('\Entities\Basket')
->findUserBasket($basket_id, $app['Core']->getAuthenticatedUser());
$params = array(
'Basket'=>$basket
);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -15,7 +15,7 @@ use \Symfony\Component\Yaml\Yaml;
/**
* Handle configuration mechanism
*
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
@@ -24,27 +24,27 @@ class Handler
{
/**
* Configuration file specification interface
* @var ConfigurationSpecification
* @var ConfigurationSpecification
*/
protected $confSpecification;
/**
* A file parser interface
* A file parser interface
* @var Parser\ParserInterface
*/
protected $parser;
/**
* The environnment selected
* @var string
* The environnment selected
* @var string
*/
private $selectedEnvironnment;
/**
* Tell handler the configuration specification ans which parser to use
*
*
* @param ConfigurationSpecification $configSpec
* @param Parser\ParserInterface $parser
* @param Parser\ParserInterface $parser
*/
public function __construct(Specification $configSpec, Parser $parser)
{
@@ -54,7 +54,7 @@ class Handler
/**
* Getter
* @return Specification
* @return Specification
*/
public function getSpecification()
{
@@ -72,7 +72,7 @@ class Handler
/**
* Handle the configuration process and return the final configuration
*
*
* @param strinig $name the name of the loaded environnement
* @return Array
*/
@@ -90,7 +90,7 @@ class Handler
}
$this->selectedEnvironnment = $selectedEnv;
if (!isset($env[$selectedEnv]))
{
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
*
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
@@ -22,17 +22,17 @@ interface Parser
{
/**
* Parse the configuration file $file to an array
*
*
* @param \SplFileObject $file the file to parse
* @return Array
*/
public function parse(\SplFileObject $file);
/**
* Dump into string from array
*
*
* @param $conf
* @return string
*/
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
*
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @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()));
}
}
/**
*
* @Override
@@ -46,4 +46,4 @@ class Yaml implements \Alchemy\Phrasea\Core\Configuration\Parser
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
*
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @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
*/
public function getConfigurationPathName();
/**
* Return the path to the configuration file
*
*
* @return string
*/
public function getConfigurationFilePath();
/**
* Return the configurationFile extension
*
*
* @return string
*/
public function getConfigurationFileExtension();
/**
* Return the name of the configuration file
*
*
* @return string
*/
public function getConfigurationFileName();
}
}

View File

@@ -33,7 +33,7 @@ class ApcCache extends ServiceAbstract implements ServiceInterface
/**
*
* @return Cache\ApcCache
* @return Cache\ApcCache
*/
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));
}
return $registry;
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -29,11 +29,11 @@ class Monolog extends ParentLog implements ServiceInterface
const JSON_OUTPUT = 'json';
const YAML_OUTPUT = 'yaml';
const VAR_DUMP_OUTPUT = 'vdump';
protected $outputs = array(
self::JSON_OUTPUT, self::YAML_OUTPUT, self::VAR_DUMP_OUTPUT
);
public function getService()
{
$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))
{
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."
, $output
, $this->name
@@ -53,10 +53,10 @@ class Monolog extends ParentLog implements ServiceInterface
return new MonologSQLLogger($this->monolog, $output);
}
public function getType()
{
return 'doctrine_monolog';
}
}
}

View File

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

View File

@@ -61,7 +61,7 @@ class Monolog extends ServiceAbstract implements ServiceInterface
if (!array_key_exists($handler, $this->handlers))
{
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."
, $handler
, $this->name

View File

@@ -20,7 +20,7 @@ use Doctrine\DBAL\Types\Type,
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
/**
*
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
@@ -137,7 +137,7 @@ class Doctrine extends ServiceAbstract implements ServiceInterface
$config->setProxyNamespace('Proxies');
$connexion = isset($options["dbal"]) ? $options["dbal"] : false;
if (!$connexion)
{
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)
{
@@ -360,7 +360,7 @@ class Doctrine extends ServiceAbstract implements ServiceInterface
if (!in_array($type, $this->caches))
{
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."
, $type
, $this->name
@@ -408,7 +408,7 @@ class Doctrine extends ServiceAbstract implements ServiceInterface
if (!in_array($type, $this->loggers))
{
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."
, $type
, $this->name

View File

@@ -26,7 +26,7 @@ abstract class ServiceAbstract
protected $name;
protected $options;
protected $configuration;
private $dependencies;
public function __construct($name, Array $options, Array $dependencies)
@@ -34,7 +34,7 @@ abstract class ServiceAbstract
$this->name = $name;
$this->options = $options;
$this->dependencies = $dependencies;
$spec = new Core\Configuration\Application();
$parser = new Core\Configuration\Parser\Yaml();
$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));
}
return $this->dependencies[$name];
}
/**
*
* @return Array
* @return Array
*/
public function getDependencies()
{
return $this->dependencies;
}
/**
*
* @return string
@@ -90,4 +90,4 @@ abstract class ServiceAbstract
return '';
}
}
}

View File

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

View File

@@ -53,7 +53,7 @@ class Twig extends ServiceAbstract implements ServiceInterface
/**
* 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
* @return void
*/
@@ -199,4 +199,4 @@ class Twig extends ServiceAbstract implements ServiceInterface
return 'template_engine';
}
}
}

View File

@@ -23,7 +23,7 @@ abstract class AbstractBuilder
{
protected static $optionsNotMandatory = array();
private $service;
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()
{
@@ -49,7 +49,7 @@ abstract class AbstractBuilder
{
throw new \Exception("Abstract factory does not create any concrete Service");
}
protected static function getServiceOptions($type, ParameterBag $configuration)
{
if(!in_array($type, static::$optionsNotMandatory))
@@ -67,7 +67,8 @@ abstract class AbstractBuilder
$options = array();
}
}
return $options;
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -44,7 +44,7 @@ class MoveCollection extends RecordHelper
/**
*
* @param \Alchemy\Phrasea\Core $core
* @return MoveCollection
* @return MoveCollection
*/
public function __construct(Core $core, Request $Request)
{
@@ -64,6 +64,7 @@ class MoveCollection extends RecordHelper
$this->available_destinations = array();
if (!$this->is_possible)
return $this;
$this->available_destinations = array_keys(
@@ -101,17 +102,17 @@ class MoveCollection extends RecordHelper
$user = $this->getCore()->getAuthenticatedUser();
$baseId = $request->get('base_id');
$base_dest =
$user->ACL()->has_right_on_base($baseId, 'canaddrecord') ?
$request->get('base_id') : false;
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()));
}
if (!$this->is_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);
foreach ($this->selection as $record)

View File

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

View File

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

View File

@@ -433,7 +433,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
$rights[$k] = $right . '_' . $base_id;
}
$parm = $request->get_parms_from_serialized_datas($rights, 'values');
foreach ($parm as $p => $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);
$base_ids = array_keys($current_user->ACL()->get_granted_base(array('canadmin')));
foreach ($this->users as $usr_id)

View File

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

View File

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

View File

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

View File

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

View File

@@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Vocabulary\ControlProvider;
/**
* ControlProvider Interface
*
*
* This interface should be used to interconnect vocabularies and metadatas
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
@@ -24,19 +24,19 @@ interface ControlProviderInterface
/**
* @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
*/
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();
/**
* @return boolean validate an $id in the vocabulary
* @return boolean validate an $id in the vocabulary
*/
public static function validate($id);
@@ -48,13 +48,13 @@ interface ControlProviderInterface
/**
* Find matching Term in the vocabulary repository
*
*
* @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
*
* @return Doctrine\Common\Collections\ArrayCollection
*
* @return Doctrine\Common\Collections\ArrayCollection
*/
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()
{
@@ -32,7 +32,7 @@ class UserProvider implements ControlProviderInterface
/**
*
* @return type
* @return type
*/
public static function getName()
{
@@ -44,7 +44,7 @@ class UserProvider implements ControlProviderInterface
* @param string $query
* @param \User_Adapter $for_user
* @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)
{
@@ -75,18 +75,19 @@ class UserProvider implements ControlProviderInterface
/**
*
* @param mixed $id
* @return boolean
* @return boolean
*/
public static function validate($id)
{
try
{
\User_Adapter::getInstance($id, appbox::get_instance());
return true;
}
catch (\Exception $e)
{
}
return false;
@@ -95,7 +96,7 @@ class UserProvider implements ControlProviderInterface
/**
*
* @param mixed $id
* @return string
* @return string
*/
public static function getValue($id)
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -34,119 +34,138 @@ class EntitiesBasketElementProxy extends \Entities\BasketElement implements \Doc
unset($this->_entityPersister, $this->_identifier);
}
}
public function getId()
{
$this->__load();
return parent::getId();
}
public function setRecordId($recordId)
{
$this->__load();
return parent::setRecordId($recordId);
}
public function getRecordId()
{
$this->__load();
return parent::getRecordId();
}
public function setSbasId($sbasId)
{
$this->__load();
return parent::setSbasId($sbasId);
}
public function getSbasId()
{
$this->__load();
return parent::getSbasId();
}
public function setOrd($ord)
{
$this->__load();
return parent::setOrd($ord);
}
public function getOrd()
{
$this->__load();
return parent::getOrd();
}
public function setCreated($created)
{
$this->__load();
return parent::setCreated($created);
}
public function getCreated()
{
$this->__load();
return parent::getCreated();
}
public function setUpdated($updated)
{
$this->__load();
return parent::setUpdated($updated);
}
public function getUpdated()
{
$this->__load();
return parent::getUpdated();
}
public function setBasket(\Entities\Basket $basket)
{
$this->__load();
return parent::setBasket($basket);
}
public function getBasket()
{
$this->__load();
return parent::getBasket();
}
public function getRecord()
{
$this->__load();
return parent::getRecord();
}
public function setRecord(\record_adapter $record)
{
$this->__load();
return parent::setRecord($record);
}
public function setLastInBasket()
{
$this->__load();
return parent::setLastInBasket();
}
public function addValidationData(\Entities\ValidationData $validationDatas)
{
$this->__load();
return parent::addValidationData($validationDatas);
}
public function getValidationDatas()
{
$this->__load();
return parent::getValidationDatas();
}
public function getUserValidationDatas(\User_Adapter $user)
{
$this->__load();
return parent::getUserValidationDatas($user);
}
@@ -170,6 +189,6 @@ class EntitiesBasketElementProxy extends \Entities\BasketElement implements \Doc
}
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);
}
}
public function getId()
{
$this->__load();
return parent::getId();
}
public function setName($name)
{
$this->__load();
return parent::setName($name);
}
public function getName()
{
$this->__load();
return parent::getName();
}
public function setDescription($description)
{
$this->__load();
return parent::setDescription($description);
}
public function getDescription()
{
$this->__load();
return parent::getDescription();
}
public function setUsrId($usrId)
{
$this->__load();
return parent::setUsrId($usrId);
}
public function getUsrId()
{
$this->__load();
return parent::getUsrId();
}
public function setPusherId($pusherId)
{
$this->__load();
return parent::setPusherId($pusherId);
}
public function getPusherId()
{
$this->__load();
return parent::getPusherId();
}
public function setArchived($archived)
{
$this->__load();
return parent::setArchived($archived);
}
public function getArchived()
{
$this->__load();
return parent::getArchived();
}
public function setCreated($created)
{
$this->__load();
return parent::setCreated($created);
}
public function getCreated()
{
$this->__load();
return parent::getCreated();
}
public function setUpdated($updated)
{
$this->__load();
return parent::setUpdated($updated);
}
public function getUpdated()
{
$this->__load();
return parent::getUpdated();
}
public function addBasketElement(\Entities\BasketElement $elements)
{
$this->__load();
return parent::addBasketElement($elements);
}
public function getElements()
{
$this->__load();
return parent::getElements();
}
public function setPusher(\User_Adapter $user)
{
$this->__load();
return parent::setPusher($user);
}
public function getPusher()
{
$this->__load();
return parent::getPusher();
}
public function setOwner(\User_Adapter $user)
{
$this->__load();
return parent::setOwner($user);
}
public function getOwner()
{
$this->__load();
return parent::getOwner();
}
public function setValidation(\Entities\ValidationSession $validation)
{
$this->__load();
return parent::setValidation($validation);
}
public function getValidation()
{
$this->__load();
return parent::getValidation();
}
public function setIsRead($isRead)
{
$this->__load();
return parent::setIsRead($isRead);
}
public function getIsRead()
{
$this->__load();
return parent::getIsRead();
}
public function hasRecord(\record_adapter $record)
{
$this->__load();
return parent::hasRecord($record);
}
public function getSize()
{
$this->__load();
return parent::getSize();
}
@@ -218,6 +245,6 @@ class EntitiesBasketProxy extends \Entities\Basket implements \Doctrine\ORM\Prox
}
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);
}
}
public function getId()
{
$this->__load();
return parent::getId();
}
public function setSbasId($sbasId)
{
$this->__load();
return parent::setSbasId($sbasId);
}
public function getSbasId()
{
$this->__load();
return parent::getSbasId();
}
public function setRecordId($recordId)
{
$this->__load();
return parent::setRecordId($recordId);
}
public function getRecordId()
{
$this->__load();
return parent::getRecordId();
}
public function setUsrId($usrId)
{
$this->__load();
return parent::setUsrId($usrId);
}
public function getUsrId()
{
$this->__load();
return parent::getUsrId();
}
public function setCreated($created)
{
$this->__load();
return parent::setCreated($created);
}
public function getCreated()
{
$this->__load();
return parent::getCreated();
}
public function setUser(\User_Adapter $user)
{
$this->__load();
return parent::setUser($user);
}
public function getUser()
{
$this->__load();
return parent::getUser();
}
public function getRecord()
{
$this->__load();
return parent::getRecord();
}
public function setRecord(\record_adapter $record)
{
$this->__load();
return parent::setRecord($record);
}
@@ -134,6 +147,6 @@ class EntitiesStoryWZProxy extends \Entities\StoryWZ implements \Doctrine\ORM\Pr
}
unset($this->_entityPersister, $this->_identifier);
}
}
}
}

View File

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

View File

@@ -34,83 +34,96 @@ class EntitiesUsrListOwnerProxy extends \Entities\UsrListOwner implements \Doctr
unset($this->_entityPersister, $this->_identifier);
}
}
public function getId()
{
$this->__load();
return parent::getId();
}
public function setUsrId($usrId)
{
$this->__load();
return parent::setUsrId($usrId);
}
public function getUsrId()
{
$this->__load();
return parent::getUsrId();
}
public function setRole($role)
{
$this->__load();
return parent::setRole($role);
}
public function getRole()
{
$this->__load();
return parent::getRole();
}
public function setCreated($created)
{
$this->__load();
return parent::setCreated($created);
}
public function getCreated()
{
$this->__load();
return parent::getCreated();
}
public function setUpdated($updated)
{
$this->__load();
return parent::setUpdated($updated);
}
public function getUpdated()
{
$this->__load();
return parent::getUpdated();
}
public function setList(\Entities\UsrList $list)
{
$this->__load();
return parent::setList($list);
}
public function getList()
{
$this->__load();
return parent::getList();
}
public function setUser(\User_Adapter $user)
{
$this->__load();
return parent::setUser($user);
}
public function getUser()
{
$this->__load();
return parent::getUser();
}
@@ -134,6 +147,6 @@ class EntitiesUsrListOwnerProxy extends \Entities\UsrListOwner implements \Doctr
}
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);
}
}
public function getId()
{
$this->__load();
return parent::getId();
}
public function setName($name)
{
$this->__load();
return parent::setName($name);
}
public function getName()
{
$this->__load();
return parent::getName();
}
public function setCreated($created)
{
$this->__load();
return parent::setCreated($created);
}
public function getCreated()
{
$this->__load();
return parent::getCreated();
}
public function setUpdated($updated)
{
$this->__load();
return parent::setUpdated($updated);
}
public function getUpdated()
{
$this->__load();
return parent::getUpdated();
}
public function addUsrListOwner(\Entities\UsrListOwner $owners)
{
$this->__load();
return parent::addUsrListOwner($owners);
}
public function getOwners()
{
$this->__load();
return parent::getOwners();
}
public function hasAccess(\User_Adapter $user)
{
$this->__load();
return parent::hasAccess($user);
}
public function getOwner(\User_Adapter $user)
{
$this->__load();
return parent::getOwner($user);
}
public function addUsrListEntry(\Entities\UsrListEntry $entry)
{
$this->__load();
return parent::addUsrListEntry($entry);
}
public function getEntries()
{
$this->__load();
return parent::getEntries();
}
@@ -134,6 +147,6 @@ class EntitiesUsrListProxy extends \Entities\UsrList implements \Doctrine\ORM\Pr
}
unset($this->_entityPersister, $this->_identifier);
}
}
}
}

View File

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

View File

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

View File

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

View File

@@ -15,7 +15,7 @@ class BasketElementRepository extends EntityRepository
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
WHERE b.usr_id = :usr_id AND e.id = :element_id';
@@ -29,10 +29,10 @@ class BasketElementRepository extends EntityRepository
return $query->getOneOrNullResult();
}
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';
$params = array(
@@ -45,7 +45,7 @@ class BasketElementRepository extends EntityRepository
return $query->getResult();
}
/**
*
* @param \record_adapter $record
@@ -54,9 +54,9 @@ class BasketElementRepository extends EntityRepository
*/
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
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';
$params = array(
@@ -70,14 +70,14 @@ class BasketElementRepository extends EntityRepository
return $query->getResult();
}
public function findReceivedValidationElementsByRecord(\record_adapter $record, \User_Adapter $user)
{
$dql = 'SELECT e FROM Entities\BasketElement e
JOIN e.basket b
$dql = 'SELECT e FROM Entities\BasketElement e
JOIN e.basket b
JOIN b.validation v
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';
$params = array(
@@ -91,12 +91,12 @@ class BasketElementRepository extends EntityRepository
return $query->getResult();
}
/**
*
* @param type $element_id
* @param \User_Adapter $user
* @return \Entities\BasketELement
* @return \Entities\BasketELement
*/
public function findElement($element_id, \User_Adapter $user)
{
@@ -116,4 +116,4 @@ class BasketElementRepository extends EntityRepository
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
*
* @param \User_Adapter $user
* @return \Doctrine\Common\Collections\ArrayCollection
* @return \Doctrine\Common\Collections\ArrayCollection
*/
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';
$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
*
* @param \User_Adapter $user
* @return \Doctrine\Common\Collections\ArrayCollection
* @return \Doctrine\Common\Collections\ArrayCollection
*/
public function findUnreadActiveByUser(\User_Adapter $user)
{
$dql = 'SELECT b FROM Entities\Basket b
WHERE b.usr_id = :usr_id
$dql = 'SELECT b FROM Entities\Basket b
WHERE b.usr_id = :usr_id
AND b.archived = false AND b.is_read = false';
$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)
*
* @param \User_Adapter $user
* @return \Doctrine\Common\Collections\ArrayCollection
* @return \Doctrine\Common\Collections\ArrayCollection
*/
public function findActiveValidationByUser(\User_Adapter $user)
{
$dql = 'SELECT b FROM Entities\Basket b
JOIN b.validation s
JOIN s.participants p
WHERE b.usr_id != ?1 AND p.usr_id = ?2
$dql = 'SELECT b FROM Entities\Basket b
JOIN b.validation s
JOIN s.participants p
WHERE b.usr_id != ?1 AND p.usr_id = ?2
AND s.expires > CURRENT_TIMESTAMP()';
$query = $this->_em->createQuery($dql);
@@ -91,7 +91,7 @@ class BasketRepository extends EntityRepository
* @throws \Exception_Forbidden
* @param type $basket_id
* @param \User_Adapter $user
* @return \Entities\Basket
* @return \Entities\Basket
*/
public function findUserBasket($basket_id, \User_Adapter $user)
{
@@ -114,8 +114,8 @@ class BasketRepository extends EntityRepository
public function findContainingRecord(\record_adapter $record)
{
$dql = 'SELECT b FROM Entities\Basket b
JOIN b.elements e
$dql = 'SELECT b FROM Entities\Basket b
JOIN b.elements e
WHERE e.record_id = :record_id AND e.sbas_id = e.sbas_id';
$params = array(
@@ -135,16 +135,16 @@ class BasketRepository extends EntityRepository
switch ($type)
{
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';
$params = array(
'usr_id' => $user->get_id()
);
break;
case self::VALIDATION_DONE:
$dql = 'SELECT b FROM Entities\Basket b
JOIN b.validation s
JOIN s.participants p
$dql = 'SELECT b FROM Entities\Basket b
JOIN b.validation s
JOIN s.participants p
WHERE b.usr_id != ?1 AND p.usr_id = ?2';
$params = array(
1 => $user->get_id()
@@ -152,7 +152,7 @@ class BasketRepository extends EntityRepository
);
break;
case self::VALIDATION_SENT:
$dql = 'SELECT b FROM Entities\Basket b
$dql = 'SELECT b FROM Entities\Basket b
JOIN b.validation v
WHERE b.usr_id = :usr_id';
$params = array(
@@ -160,8 +160,8 @@ class BasketRepository extends EntityRepository
);
break;
default:
$dql = 'SELECT b FROM Entities\Basket b
LEFT JOIN b.validation s LEFT JOIN s.participants p
$dql = 'SELECT b FROM Entities\Basket b
LEFT JOIN b.validation s LEFT JOIN s.participants p
WHERE (b.usr_id = :usr_id OR p.usr_id = :validating_usr_id)';
$params = array(
'usr_id' => $user->get_id(),
@@ -169,19 +169,19 @@ class BasketRepository extends EntityRepository
);
break;
}
if (ctype_digit($year) && strlen($year) == 4)
{
$dql .= ' AND b.created >= :min_date AND b.created <= :max_date ';
$params['min_date'] = sprintf('%d-01-01 00:00:00', $year);
$params['max_date'] = sprintf('%d-12-31 23:59:59', $year);
}
if (trim($query) !== '')
{
$dql .= ' AND (b.name LIKE :name OR b.description LIKE :description) ';
$params['name'] = '%'.$query.'%';
$params['description'] = '%'.$query.'%';
}

View File

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

View File

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

View File

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

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