From 88c3df2ef702c59dff0bf94e06e21113d258e726 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Mon, 17 Jun 2013 15:05:20 +0200 Subject: [PATCH] Regenerate doctrine entities and proxies --- lib/Alchemy/Phrasea/Border/Manager.php | 4 +- .../Phrasea/Controller/Client/Baskets.php | 2 +- .../Phrasea/Controller/Prod/Basket.php | 6 +- lib/Alchemy/Phrasea/Controller/Prod/Push.php | 6 +- .../Phrasea/Controller/Prod/UsrLists.php | 6 +- lib/Doctrine/Entities/AuthFailure.php | 36 +- lib/Doctrine/Entities/Basket.php | 280 ++++----- lib/Doctrine/Entities/BasketElement.php | 184 +++--- lib/Doctrine/Entities/LazaretAttribute.php | 39 +- lib/Doctrine/Entities/LazaretCheck.php | 76 +-- lib/Doctrine/Entities/LazaretFile.php | 552 +++++++++--------- lib/Doctrine/Entities/LazaretSession.php | 104 ++-- lib/Doctrine/Entities/Session.php | 146 ++--- lib/Doctrine/Entities/SessionModule.php | 48 +- lib/Doctrine/Entities/StoryWZ.php | 94 +-- lib/Doctrine/Entities/UsrAuthProvider.php | 68 ++- lib/Doctrine/Entities/UsrList.php | 180 +++--- lib/Doctrine/Entities/UsrListEntry.php | 160 ++--- lib/Doctrine/Entities/UsrListOwner.php | 83 +-- lib/Doctrine/Entities/ValidationData.php | 69 ++- .../Entities/ValidationParticipant.php | 246 ++++---- lib/Doctrine/Entities/ValidationSession.php | 409 +++++-------- .../Proxies/__CG__EntitiesAuthFailure.php | 124 ++++ lib/Doctrine/Proxies/__CG__EntitiesBasket.php | 118 ++-- .../Proxies/__CG__EntitiesBasketElement.php | 58 +- .../__CG__EntitiesLazaretAttribute.php | 2 +- .../Proxies/__CG__EntitiesLazaretCheck.php | 26 +- .../Proxies/__CG__EntitiesLazaretFile.php | 150 ++--- .../Proxies/__CG__EntitiesLazaretSession.php | 36 +- .../Proxies/__CG__EntitiesSession.php | 18 +- .../Proxies/__CG__EntitiesSessionModule.php | 26 +- .../Proxies/__CG__EntitiesStoryWZ.php | 34 +- .../Proxies/__CG__EntitiesUsrAuthProvider.php | 142 +++++ .../Proxies/__CG__EntitiesUsrList.php | 64 +- .../Proxies/__CG__EntitiesUsrListEntry.php | 28 +- .../Proxies/__CG__EntitiesUsrListOwner.php | 26 +- .../Proxies/__CG__EntitiesValidationData.php | 6 +- .../__CG__EntitiesValidationParticipant.php | 88 +-- .../__CG__EntitiesValidationSession.php | 94 +-- .../Repositories/BasketRepository.php | 4 +- .../Repositories/SessionModuleRepository.php | 2 +- .../Repositories/SessionRepository.php | 2 +- .../Repositories/UsrListEntryRepository.php | 5 +- .../Repositories/UsrListRepository.php | 1 - .../ValidationParticipantRepository.php | 1 - lib/classes/User/Adapter.php | 2 +- lib/classes/patch/3810.php | 69 +++ lib/classes/set/order.php | 2 +- .../Basket/LoadOneBasketEnv.php | 8 +- .../PhraseaFixture/UsrLists/UsrList.php | 2 +- .../PhraseaFixture/UsrLists/UsrListEntry.php | 2 +- .../LoadOneValidationSession.php | 3 - .../Phrasea/Controller/Client/BasketsTest.php | 2 +- .../Phrasea/Controller/Prod/BasketTest.php | 9 +- .../Phrasea/Controller/Prod/LazaretTest.php | 10 +- .../Phrasea/Controller/Prod/RecordsTest.php | 2 +- .../Phrasea/Controller/RecordsRequestTest.php | 2 +- .../classes/Doctrine/Entities/BasketTest.php | 5 - tests/classes/PhraseanetPHPUnitAbstract.php | 8 +- tests/classes/record/adapterTest.php | 4 +- 60 files changed, 2141 insertions(+), 1842 deletions(-) create mode 100644 lib/Doctrine/Proxies/__CG__EntitiesAuthFailure.php create mode 100644 lib/Doctrine/Proxies/__CG__EntitiesUsrAuthProvider.php create mode 100644 lib/classes/patch/3810.php diff --git a/lib/Alchemy/Phrasea/Border/Manager.php b/lib/Alchemy/Phrasea/Border/Manager.php index 4d205f52f7..aeaa1a3f7e 100644 --- a/lib/Alchemy/Phrasea/Border/Manager.php +++ b/lib/Alchemy/Phrasea/Border/Manager.php @@ -471,7 +471,7 @@ class Manager $attribute->setValue($fileAttribute->asString()); $attribute->setLazaretFile($lazaretFile); - $lazaretFile->addLazaretAttribute($attribute); + $lazaretFile->addAttribute($attribute); $this->app['EM']->persist($attribute); } @@ -483,7 +483,7 @@ class Manager $check->setCheckClassname(get_class($response->getChecker())); $check->setLazaretFile($lazaretFile); - $lazaretFile->addLazaretCheck($check); + $lazaretFile->addCheck($check); $this->app['EM']->persist($check); } diff --git a/lib/Alchemy/Phrasea/Controller/Client/Baskets.php b/lib/Alchemy/Phrasea/Controller/Client/Baskets.php index 0621669926..2916ef8695 100644 --- a/lib/Alchemy/Phrasea/Controller/Client/Baskets.php +++ b/lib/Alchemy/Phrasea/Controller/Client/Baskets.php @@ -224,7 +224,7 @@ class Baskets implements ControllerProviderInterface $basketElement = new BasketElement(); $basketElement->setRecord($record); $basketElement->setBasket($basket); - $basket->addBasketElement($basketElement); + $basket->addElement($basketElement); $app['EM']->persist($basket); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Basket.php b/lib/Alchemy/Phrasea/Controller/Prod/Basket.php index f70307784c..e63b273337 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Basket.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Basket.php @@ -190,7 +190,7 @@ class Basket implements ControllerProviderInterface $app['EM']->persist($basket_element); - $Basket->addBasketElement($basket_element); + $Basket->addElement($basket_element); $n++; } @@ -390,7 +390,7 @@ class Basket implements ControllerProviderInterface $app['EM']->persist($basket_element); - $basket->addBasketElement($basket_element); + $basket->addElement($basket_element); if (null !== $validationSession = $basket->getValidation()) { @@ -438,7 +438,7 @@ class Basket implements ControllerProviderInterface } $basket_element->setBasket($basket); - $basket->addBasketElement($basket_element); + $basket->addElement($basket_element); $n++; } diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Push.php b/lib/Alchemy/Phrasea/Controller/Prod/Push.php index df58094346..0c6e185f5b 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Push.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Push.php @@ -198,7 +198,7 @@ class Push implements ControllerProviderInterface $app['EM']->persist($BasketElement); - $Basket->addBasketElement($BasketElement); + $Basket->addElement($BasketElement); if ($receiver['HD']) { $user_receiver->ACL()->grant_hd_on( @@ -314,7 +314,7 @@ class Push implements ControllerProviderInterface $app['EM']->persist($BasketElement); - $Basket->addBasketElement($BasketElement); + $Basket->addElement($BasketElement); } $app['EM']->flush(); } @@ -410,7 +410,7 @@ class Push implements ControllerProviderInterface $app['phraseanet.logger']($BasketElement->getRecord($app)->get_databox()) ->log($BasketElement->getRecord($app), \Session_Logger::EVENT_PUSH, $participant_user->get_id(), ''); - $Participant->addValidationData($ValidationData); + $Participant->addData($ValidationData); } $Participant = $app['EM']->merge($Participant); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php b/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php index 9f47f7f9bc..7462ad9ef2 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php @@ -198,7 +198,7 @@ class UsrLists implements ControllerProviderInterface $Owner->setList($List); $List->setName($list_name); - $List->addUsrListOwner($Owner); + $List->addOwner($Owner); $app['EM']->persist($Owner); $app['EM']->persist($List); @@ -410,7 +410,7 @@ class UsrLists implements ControllerProviderInterface $entry->setUser($user_entry); $entry->setList($list); - $list->addUsrListEntry($entry); + $list->addEntrie($entry); $app['EM']->persist($entry); @@ -505,7 +505,7 @@ class UsrLists implements ControllerProviderInterface $owner->setList($list); $owner->setUser($new_owner); - $list->addUsrListOwner($owner); + $list->addOwner($owner); $app['EM']->persist($owner); } diff --git a/lib/Doctrine/Entities/AuthFailure.php b/lib/Doctrine/Entities/AuthFailure.php index 3fd7832962..b2121eee59 100644 --- a/lib/Doctrine/Entities/AuthFailure.php +++ b/lib/Doctrine/Entities/AuthFailure.php @@ -1,5 +1,14 @@ username = $username; - + return $this; } /** * Get username * - * @return string + * @return string */ public function getUsername() { @@ -71,20 +79,20 @@ class AuthFailure /** * Set ip * - * @param string $ip + * @param string $ip * @return AuthFailure */ public function setIp($ip) { $this->ip = $ip; - + return $this; } /** * Get ip * - * @return string + * @return string */ public function getIp() { @@ -94,20 +102,20 @@ class AuthFailure /** * Set locked * - * @param boolean $locked + * @param boolean $locked * @return AuthFailure */ public function setLocked($locked) { $this->locked = $locked; - + return $this; } /** * Get locked * - * @return boolean + * @return boolean */ public function getLocked() { @@ -117,20 +125,20 @@ class AuthFailure /** * Set created * - * @param \DateTime $created + * @param \DateTime $created * @return AuthFailure */ public function setCreated($created) { $this->created = $created; - + return $this; } /** * Get created * - * @return \DateTime + * @return \DateTime */ public function getCreated() { diff --git a/lib/Doctrine/Entities/Basket.php b/lib/Doctrine/Entities/Basket.php index 263c92ccfe..634429e195 100644 --- a/lib/Doctrine/Entities/Basket.php +++ b/lib/Doctrine/Entities/Basket.php @@ -14,9 +14,7 @@ namespace Entities; use Alchemy\Phrasea\Application; /** - * - * @license http://opensource.org/licenses/gpl-3.0 GPLv3 - * @link www.phraseanet.com + * Basket */ class Basket { @@ -25,50 +23,63 @@ class Basket const ELEMENTSORDER_ASC = 'asc'; /** - * @var integer $id + * @var integer */ - protected $id; + private $id; /** - * @var string $name + * @var string */ - protected $name; + private $name; /** - * @var text $description + * @var string */ - protected $description; + private $description; /** - * @var integer $usr_id + * @var integer */ - protected $usr_id; + private $usr_id; /** - * @var integer $pusher_id + * @var boolean */ - protected $pusher_id; + private $is_read = false; /** - * @var boolean $archived + * @var integer */ - protected $archived = false; + private $pusher_id; /** - * @var datetime $created + * @var boolean */ - protected $created; + private $archived = false; /** - * @var datetime $updated + * @var \DateTime */ - protected $updated; + private $created; /** - * @var Entities\BasketElement + * @var \DateTime */ - protected $elements; + private $updated; + /** + * @var \Entities\ValidationSession + */ + private $validation; + + /** + * @var \Doctrine\Common\Collections\Collection + */ + private $elements; + + /** + * Constructor + */ public function __construct() { $this->elements = new \Doctrine\Common\Collections\ArrayCollection(); @@ -87,11 +98,14 @@ class Basket /** * Set name * - * @param string $name + * @param string $name + * @return Basket */ public function setName($name) { $this->name = $name; + + return $this; } /** @@ -107,17 +121,20 @@ class Basket /** * Set description * - * @param text $description + * @param string $description + * @return Basket */ public function setDescription($description) { $this->description = $description; + + return $this; } /** * Get description * - * @return text + * @return string */ public function getDescription() { @@ -127,11 +144,14 @@ class Basket /** * Set usr_id * - * @param integer $usrId + * @param integer $usrId + * @return Basket */ public function setUsrId($usrId) { $this->usr_id = $usrId; + + return $this; } /** @@ -144,14 +164,52 @@ class Basket return $this->usr_id; } + public function setOwner(\User_Adapter $user) + { + $this->setUsrId($user->get_id()); + } + + public function getOwner(Application $app) + { + if ($this->getUsrId()) { + return \User_Adapter::getInstance($this->getUsrId(), $app); + } + } + + /** + * Set is_read + * + * @param boolean $isRead + * @return Basket + */ + public function setIsRead($isRead) + { + $this->is_read = $isRead; + + return $this; + } + + /** + * Get is_read + * + * @return boolean + */ + public function getIsRead() + { + return $this->is_read; + } + /** * Set pusher_id * - * @param integer $pusherId + * @param integer $pusherId + * @return Basket */ public function setPusherId($pusherId) { $this->pusher_id = $pusherId; + + return $this; } /** @@ -164,14 +222,29 @@ class Basket return $this->pusher_id; } + public function setPusher(\User_Adapter $user) + { + $this->setPusherId($user->get_id()); + } + + public function getPusher(Application $app) + { + if ($this->getPusherId()) { + return \User_Adapter::getInstance($this->getPusherId(), $app); + } + } + /** * Set archived * - * @param boolean $archived + * @param boolean $archived + * @return Basket */ public function setArchived($archived) { $this->archived = $archived; + + return $this; } /** @@ -187,17 +260,20 @@ class Basket /** * Set created * - * @param datetime $created + * @param \DateTime $created + * @return Basket */ public function setCreated($created) { $this->created = $created; + + return $this; } /** * Get created * - * @return datetime + * @return \DateTime */ public function getCreated() { @@ -207,37 +283,76 @@ class Basket /** * Set updated * - * @param datetime $updated + * @param \DateTime $updated + * @return Basket */ public function setUpdated($updated) { $this->updated = $updated; + + return $this; } /** * Get updated * - * @return datetime + * @return \DateTime */ public function getUpdated() { return $this->updated; } + /** + * Set validation + * + * @param \Entities\ValidationSession $validation + * @return Basket + */ + public function setValidation(\Entities\ValidationSession $validation = null) + { + $this->validation = $validation; + + return $this; + } + + /** + * Get validation + * + * @return \Entities\ValidationSession + */ + public function getValidation() + { + return $this->validation; + } + /** * Add elements * - * @param Entities\BasketElement $elements + * @param \Entities\BasketElement $elements + * @return Basket */ - public function addBasketElement(\Entities\BasketElement $elements) + public function addElement(\Entities\BasketElement $elements) { $this->elements[] = $elements; + + return $this; + } + + /** + * Remove elements + * + * @param \Entities\BasketElement $elements + */ + public function removeElement(\Entities\BasketElement $elements) + { + $this->elements->removeElement($elements); } /** * Get elements * - * @return Doctrine\Common\Collections\Collection + * @return \Doctrine\Common\Collections\Collection */ public function getElements() { @@ -319,78 +434,6 @@ class Basket return $total_el1 < $total_el2 ? 1 : -1; } - public function setPusher(\User_Adapter $user) - { - $this->setPusherId($user->get_id()); - } - - public function getPusher(Application $app) - { - if ($this->getPusherId()) { - return \User_Adapter::getInstance($this->getPusherId(), $app); - } - } - - public function setOwner(\User_Adapter $user) - { - $this->setUsrId($user->get_id()); - } - - public function getOwner(Application $app) - { - if ($this->getUsrId()) { - return \User_Adapter::getInstance($this->getUsrId(), $app); - } - } - /** - * @var Entities\ValidationSession - */ - protected $validation; - - /** - * Set validation - * - * @param Entities\ValidationSession $validation - */ - public function setValidation(\Entities\ValidationSession $validation) - { - $this->validation = $validation; - } - - /** - * Get validation - * - * @return Entities\ValidationSession - */ - public function getValidation() - { - return $this->validation; - } - /** - * @var boolean $is_read - */ - protected $is_read = true; - - /** - * Set is_read - * - * @param boolean $isRead - */ - public function setIsRead($isRead) - { - $this->is_read = $isRead; - } - - /** - * Get is_read - * - * @return boolean - */ - public function getIsRead() - { - return $this->is_read; - } - public function hasRecord(Application $app, \record_adapter $record) { foreach ($this->getElements() as $basket_element) { @@ -423,27 +466,4 @@ class Basket return $totSize; } - - /** - * Add elements - * - * @param \Entities\BasketElement $elements - * @return Basket - */ - public function addElement(\Entities\BasketElement $elements) - { - $this->elements[] = $elements; - - return $this; - } - - /** - * Remove elements - * - * @param \Entities\BasketElement $elements - */ - public function removeElement(\Entities\BasketElement $elements) - { - $this->elements->removeElement($elements); - } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/BasketElement.php b/lib/Doctrine/Entities/BasketElement.php index d52ff77eb9..17f196bb85 100644 --- a/lib/Doctrine/Entities/BasketElement.php +++ b/lib/Doctrine/Entities/BasketElement.php @@ -12,49 +12,60 @@ namespace Entities; use Alchemy\Phrasea\Application; +use Doctrine\ORM\Mapping as ORM; /** - * Kernel - * - * @license http://opensource.org/licenses/gpl-3.0 GPLv3 - * @link www.phraseanet.com + * BasketElement */ class BasketElement { /** - * @var integer $id + * @var integer */ - protected $id; + private $id; /** - * @var integer $record_id + * @var integer */ - protected $record_id; + private $record_id; /** - * @var integer $sbas_id + * @var integer */ - protected $sbas_id; + private $sbas_id; /** - * @var integer $ord + * @var integer */ - protected $ord; + private $ord; /** - * @var datetime $created + * @var \DateTime */ - protected $created; + private $created; /** - * @var datetime $updated + * @var \DateTime */ - protected $updated; + private $updated; /** - * @var Entities\Basket + * @var \Doctrine\Common\Collections\Collection */ - protected $basket; + private $validation_datas; + + /** + * @var \Entities\Basket + */ + private $basket; + + /** + * Constructor + */ + public function __construct() + { + $this->validation_datas = new \Doctrine\Common\Collections\ArrayCollection(); + } /** * Get id @@ -69,11 +80,14 @@ class BasketElement /** * Set record_id * - * @param integer $recordId + * @param integer $recordId + * @return BasketElement */ public function setRecordId($recordId) { $this->record_id = $recordId; + + return $this; } /** @@ -89,11 +103,14 @@ class BasketElement /** * Set sbas_id * - * @param integer $sbasId + * @param integer $sbasId + * @return BasketElement */ public function setSbasId($sbasId) { $this->sbas_id = $sbasId; + + return $this; } /** @@ -106,14 +123,28 @@ class BasketElement return $this->sbas_id; } + public function getRecord(Application $app) + { + return new \record_adapter($app, $this->getSbasId(), $this->getRecordId(), $this->getOrd()); + } + + public function setRecord(\record_adapter $record) + { + $this->setRecordId($record->get_record_id()); + $this->setSbasId($record->get_sbas_id()); + } + /** * Set ord * - * @param integer $ord + * @param integer $ord + * @return BasketElement */ public function setOrd($ord) { $this->ord = $ord; + + return $this; } /** @@ -129,17 +160,20 @@ class BasketElement /** * Set created * - * @param datetime $created + * @param \DateTime $created + * @return BasketElement */ public function setCreated($created) { $this->created = $created; + + return $this; } /** * Get created * - * @return datetime + * @return \DateTime */ public function getCreated() { @@ -149,87 +183,89 @@ class BasketElement /** * Set updated * - * @param datetime $updated + * @param \DateTime $updated + * @return BasketElement */ public function setUpdated($updated) { $this->updated = $updated; + + return $this; } /** * Get updated * - * @return datetime + * @return \DateTime */ public function getUpdated() { return $this->updated; } + /** + * Add validation_datas + * + * @param \Entities\ValidationData $validationDatas + * @return BasketElement + */ + public function addValidationData(\Entities\ValidationData $validationDatas) + { + $this->validation_datas[] = $validationDatas; + + return $this; + } + + /** + * Remove validation_datas + * + * @param \Entities\ValidationData $validationDatas + */ + public function removeValidationData(\Entities\ValidationData $validationDatas) + { + $this->validation_datas->removeElement($validationDatas); + } + + /** + * Get validation_datas + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getValidationDatas() + { + return $this->validation_datas; + } + /** * Set basket * - * @param Entities\Basket $basket + * @param \Entities\Basket $basket + * @return BasketElement */ - public function setBasket(\Entities\Basket $basket) + public function setBasket(\Entities\Basket $basket = null) { $this->basket = $basket; + + return $this; } /** * Get basket * - * @return Entities\Basket + * @return \Entities\Basket */ public function getBasket() { return $this->basket; } - public function getRecord(Application $app) - { - return new \record_adapter($app, $this->getSbasId(), $this->getRecordId(), $this->getOrd()); - } - - public function setRecord(\record_adapter $record) - { - $this->setRecordId($record->get_record_id()); - $this->setSbasId($record->get_sbas_id()); - } - + /** + * @ORM\PrePersist + */ public function setLastInBasket() { $this->setOrd($this->getBasket()->getElements()->count() + 1); } - /** - * @var Entities\ValidationData - */ - protected $validation_datas; - - public function __construct() - { - $this->validation_datas = new \Doctrine\Common\Collections\ArrayCollection(); - } - - /** - * Add validation_datas - * - * @param Entities\ValidationData $validationDatas - */ - public function addValidationData(\Entities\ValidationData $validationDatas) - { - $this->validation_datas[] = $validationDatas; - } - - /** - * Get validation_datas - * - * @return Doctrine\Common\Collections\Collection - */ - public function getValidationDatas() - { - return $this->validation_datas; - } /** * @@ -246,14 +282,4 @@ class BasketElement throw new \Exception('There is no such participant ' . $user->get_email()); } - - /** - * Remove validation_datas - * - * @param \Entities\ValidationData $validationDatas - */ - public function removeValidationData(\Entities\ValidationData $validationDatas) - { - $this->validation_datas->removeElement($validationDatas); - } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/LazaretAttribute.php b/lib/Doctrine/Entities/LazaretAttribute.php index b4bb584b17..0484aa0df1 100644 --- a/lib/Doctrine/Entities/LazaretAttribute.php +++ b/lib/Doctrine/Entities/LazaretAttribute.php @@ -1,44 +1,53 @@ lazaretFile; } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/LazaretCheck.php b/lib/Doctrine/Entities/LazaretCheck.php index 3ce9c8a9c2..4de1fd2c2e 100644 --- a/lib/Doctrine/Entities/LazaretCheck.php +++ b/lib/Doctrine/Entities/LazaretCheck.php @@ -1,28 +1,38 @@ id; } - /** - * Set lazaretFile - * - * @param Entities\LazaretFile $lazaretFile - * @return LazaretCheck - */ - public function setLazaretFile(\Entities\LazaretFile $lazaretFile = null) - { - $this->lazaretFile = $lazaretFile; - - return $this; - } - - /** - * Get lazaretFile - * - * @return Entities\LazaretFile - */ - public function getLazaretFile() - { - return $this->lazaretFile; - } - /** * Set checkClassname * @@ -79,6 +66,29 @@ class LazaretCheck return $this->checkClassname; } + /** + * Set lazaretFile + * + * @param \Entities\LazaretFile $lazaretFile + * @return LazaretCheck + */ + public function setLazaretFile(\Entities\LazaretFile $lazaretFile = null) + { + $this->lazaretFile = $lazaretFile; + + return $this; + } + + /** + * Get lazaretFile + * + * @return \Entities\LazaretFile + */ + public function getLazaretFile() + { + return $this->lazaretFile; + } + /** * Get checker message * @@ -88,10 +98,10 @@ class LazaretCheck { $className = $this->getCheckClassname(); - if(method_exists($className, "getMessage")) { + if (method_exists($className, "getMessage")) { return $className::getMessage(); } else { return ''; } } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/LazaretFile.php b/lib/Doctrine/Entities/LazaretFile.php index 58c467f62f..615a077462 100644 --- a/lib/Doctrine/Entities/LazaretFile.php +++ b/lib/Doctrine/Entities/LazaretFile.php @@ -1,72 +1,95 @@ attributes = new \Doctrine\Common\Collections\ArrayCollection(); + $this->checks = new \Doctrine\Common\Collections\ArrayCollection(); } /** @@ -79,6 +102,75 @@ class LazaretFile return $this->id; } + /** + * Set filename + * + * @param string $filename + * @return LazaretFile + */ + public function setFilename($filename) + { + $this->filename = $filename; + + return $this; + } + + /** + * Get filename + * + * @return string + */ + public function getFilename() + { + return $this->filename; + } + + /** + * Set thumbFilename + * + * @param string $thumbFilename + * @return LazaretFile + */ + public function setThumbFilename($thumbFilename) + { + $this->thumbFilename = $thumbFilename; + + return $this; + } + + /** + * Get thumbFilename + * + * @return string + */ + public function getThumbFilename() + { + return $this->thumbFilename; + } + + /** + * Set originalName + * + * @param string $originalName + * @return LazaretFile + */ + public function setOriginalName($originalName) + { + $this->originalName = $originalName; + + return $this; + } + + /** + * Get originalName + * + * @return string + */ + public function getOriginalName() + { + return $this->originalName; + } + /** * Set base_id * @@ -102,6 +194,16 @@ class LazaretFile return $this->base_id; } + /** + * Get the Destination Collection + * + * @return \collection + */ + public function getCollection(Application $app) + { + return \collection::get_from_base_id($app, $this->getBaseId()); + } + /** * Set uuid * @@ -148,144 +250,6 @@ class LazaretFile return $this->sha256; } - /** - * Set created - * - * @param datetime $created - * @return LazaretFile - */ - public function setCreated($created) - { - $this->created = $created; - - return $this; - } - - /** - * Get created - * - * @return datetime - */ - public function getCreated() - { - return $this->created; - } - - /** - * Set updated - * - * @param datetime $updated - * @return LazaretFile - */ - public function setUpdated($updated) - { - $this->updated = $updated; - - return $this; - } - - /** - * Get updated - * - * @return datetime - */ - public function getUpdated() - { - return $this->updated; - } - - /** - * Add attributes - * - * @param Entities\LazaretAttribute $attributes - * @return LazaretFile - */ - public function addLazaretAttribute(\Entities\LazaretAttribute $attributes) - { - $this->attributes[] = $attributes; - - return $this; - } - - /** - * Get attributes - * - * @return Doctrine\Common\Collections\Collection - */ - public function getAttributes() - { - return $this->attributes; - } - - /** - * Set session - * - * @param Entities\LazaretSession $session - * @return LazaretFile - */ - public function setSession(\Entities\LazaretSession $session = null) - { - $this->session = $session; - - return $this; - } - - /** - * Get session - * - * @return Entities\LazaretSession - */ - public function getSession() - { - return $this->session; - } - - /** - * Set originalName - * - * @param string $originalName - * @return LazaretFile - */ - public function setOriginalName($originalName) - { - $this->originalName = $originalName; - - return $this; - } - - /** - * Get originalName - * - * @return string - */ - public function getOriginalName() - { - return $this->originalName; - } - - /** - * Add checks - * - * @param Entities\LazaretCheck $checks - * @return LazaretFile - */ - public function addLazaretCheck(\Entities\LazaretCheck $checks) - { - $this->checks[] = $checks; - - return $this; - } - - /** - * Get checks - * - * @return Doctrine\Common\Collections\Collection - */ - public function getChecks() - { - return $this->checks; - } - /** * Set forced * @@ -310,13 +274,138 @@ class LazaretFile } /** - * Get the Destination Collection + * Set created * - * @return \collection + * @param \DateTime $created + * @return LazaretFile */ - public function getCollection(Application $app) + public function setCreated($created) { - return \collection::get_from_base_id($app, $this->getBaseId()); + $this->created = $created; + + return $this; + } + + /** + * Get created + * + * @return \DateTime + */ + public function getCreated() + { + return $this->created; + } + + /** + * Set updated + * + * @param \DateTime $updated + * @return LazaretFile + */ + public function setUpdated($updated) + { + $this->updated = $updated; + + return $this; + } + + /** + * Get updated + * + * @return \DateTime + */ + public function getUpdated() + { + return $this->updated; + } + + /** + * Add attributes + * + * @param \Entities\LazaretAttribute $attributes + * @return LazaretFile + */ + public function addAttribute(\Entities\LazaretAttribute $attributes) + { + $this->attributes[] = $attributes; + + return $this; + } + + /** + * Remove attributes + * + * @param \Entities\LazaretAttribute $attributes + */ + public function removeAttribute(\Entities\LazaretAttribute $attributes) + { + $this->attributes->removeElement($attributes); + } + + /** + * Get attributes + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Add checks + * + * @param \Entities\LazaretCheck $checks + * @return LazaretFile + */ + public function addCheck(\Entities\LazaretCheck $checks) + { + $this->checks[] = $checks; + + return $this; + } + + /** + * Remove checks + * + * @param \Entities\LazaretCheck $checks + */ + public function removeCheck(\Entities\LazaretCheck $checks) + { + $this->checks->removeElement($checks); + } + + /** + * Get checks + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getChecks() + { + return $this->checks; + } + + /** + * Set session + * + * @param \Entities\LazaretSession $session + * @return LazaretFile + */ + public function setSession(\Entities\LazaretSession $session = null) + { + $this->session = $session; + + return $this; + } + + /** + * Get session + * + * @return \Entities\LazaretSession + */ + public function getSession() + { + return $this->session; } /** @@ -346,105 +435,4 @@ class LazaretFile return $ret; } - - /** - * @var string $filename - */ - private $filename; - - /** - * @var string $thumbFilename - */ - private $thumbFilename; - - - /** - * Set filename - * - * @param string $filename - * @return LazaretFile - */ - public function setFilename($filename) - { - $this->filename = $filename; - return $this; - } - - /** - * Get filename - * - * @return string - */ - public function getFilename() - { - return $this->filename; - } - - /** - * Set thumbFilename - * - * @param string $thumbFilename - * @return LazaretFile - */ - public function setThumbFilename($thumbFilename) - { - $this->thumbFilename = $thumbFilename; - return $this; - } - - /** - * Get thumbFilename - * - * @return string - */ - public function getThumbFilename() - { - return $this->thumbFilename; - } - - /** - * Add attributes - * - * @param \Entities\LazaretAttribute $attributes - * @return LazaretFile - */ - public function addAttribute(\Entities\LazaretAttribute $attributes) - { - $this->attributes[] = $attributes; - - return $this; - } - - /** - * Remove attributes - * - * @param \Entities\LazaretAttribute $attributes - */ - public function removeAttribute(\Entities\LazaretAttribute $attributes) - { - $this->attributes->removeElement($attributes); - } - - /** - * Add checks - * - * @param \Entities\LazaretCheck $checks - * @return LazaretFile - */ - public function addCheck(\Entities\LazaretCheck $checks) - { - $this->checks[] = $checks; - - return $this; - } - - /** - * Remove checks - * - * @param \Entities\LazaretCheck $checks - */ - public function removeCheck(\Entities\LazaretCheck $checks) - { - $this->checks->removeElement($checks); - } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/LazaretSession.php b/lib/Doctrine/Entities/LazaretSession.php index be335f5222..33f84ad7e6 100644 --- a/lib/Doctrine/Entities/LazaretSession.php +++ b/lib/Doctrine/Entities/LazaretSession.php @@ -1,39 +1,51 @@ files = new \Doctrine\Common\Collections\ArrayCollection(); @@ -62,6 +74,16 @@ class LazaretSession return $this; } + /** + * Get usr_id + * + * @return integer + */ + public function getUsrId() + { + return $this->usr_id; + } + /** * Get user * @@ -83,7 +105,7 @@ class LazaretSession /** * Set created * - * @param datetime $created + * @param \DateTime $created * @return LazaretSession */ public function setCreated($created) @@ -96,7 +118,7 @@ class LazaretSession /** * Get created * - * @return datetime + * @return \DateTime */ public function getCreated() { @@ -106,7 +128,7 @@ class LazaretSession /** * Set updated * - * @param datetime $updated + * @param \DateTime $updated * @return LazaretSession */ public function setUpdated($updated) @@ -119,7 +141,7 @@ class LazaretSession /** * Get updated * - * @return datetime + * @return \DateTime */ public function getUpdated() { @@ -129,59 +151,13 @@ class LazaretSession /** * Add files * - * @param Entities\LazaretFile $files - * @return LazaretSession - */ - public function addLazaretFiles(\Entities\LazaretFile $files) - { - $this->files[] = $files; - - return $this; - } - - /** - * Get files - * - * @return Doctrine\Common\Collections\Collection - */ - public function getFiles() - { - return $this->files; - } - - /** - * Add files - * - * @param Entities\LazaretFile $files - * @return LazaretSession - */ - public function addLazaretFile(\Entities\LazaretFile $files) - { - $this->files[] = $files; - - return $this; - } - - /** - * Get usr_id - * - * @return integer - */ - public function getUsrId() - { - return $this->usr_id; - } - - /** - * Add files - * - * @param \Entities\LazaretFile $files + * @param \Entities\LazaretFile $files * @return LazaretSession */ public function addFile(\Entities\LazaretFile $files) { $this->files[] = $files; - + return $this; } @@ -194,4 +170,14 @@ class LazaretSession { $this->files->removeElement($files); } -} \ No newline at end of file + + /** + * Get files + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getFiles() + { + return $this->files; + } +} diff --git a/lib/Doctrine/Entities/Session.php b/lib/Doctrine/Entities/Session.php index 333722bc45..e4c74907c5 100644 --- a/lib/Doctrine/Entities/Session.php +++ b/lib/Doctrine/Entities/Session.php @@ -1,80 +1,101 @@ modules = new \Doctrine\Common\Collections\ArrayCollection(); + } + /** * Get id * @@ -93,12 +114,13 @@ class Session /** * Set usr_id * - * @param integer $usrId + * @param integer $usrId * @return Session */ public function setUsrId($usrId) { $this->usr_id = $usrId; + return $this; } @@ -122,12 +144,13 @@ class Session /** * Set user_agent * - * @param string $userAgent + * @param string $userAgent * @return Session */ public function setUserAgent($userAgent) { $this->user_agent = $userAgent; + return $this; } @@ -144,12 +167,13 @@ class Session /** * Set ip_address * - * @param string $ipAddress + * @param string $ipAddress * @return Session */ public function setIpAddress($ipAddress) { $this->ip_address = $ipAddress; + return $this; } @@ -166,12 +190,13 @@ class Session /** * Set platform * - * @param string $platform + * @param string $platform * @return Session */ public function setPlatform($platform) { $this->platform = $platform; + return $this; } @@ -188,12 +213,13 @@ class Session /** * Set browser_name * - * @param string $browserName + * @param string $browserName * @return Session */ public function setBrowserName($browserName) { $this->browser_name = $browserName; + return $this; } @@ -210,12 +236,13 @@ class Session /** * Set browser_version * - * @param string $browserVersion + * @param string $browserVersion * @return Session */ public function setBrowserVersion($browserVersion) { $this->browser_version = $browserVersion; + return $this; } @@ -232,12 +259,13 @@ class Session /** * Set screen_width * - * @param integer $screenWidth + * @param integer $screenWidth * @return Session */ public function setScreenWidth($screenWidth) { $this->screen_width = $screenWidth; + return $this; } @@ -254,12 +282,13 @@ class Session /** * Set screen_height * - * @param integer $screenHeight + * @param integer $screenHeight * @return Session */ public function setScreenHeight($screenHeight) { $this->screen_height = $screenHeight; + return $this; } @@ -276,12 +305,13 @@ class Session /** * Set token * - * @param string $token + * @param string $token * @return Session */ public function setToken($token) { $this->token = $token; + return $this; } @@ -298,12 +328,13 @@ class Session /** * Set nonce * - * @param string $nonce + * @param string $nonce * @return Session */ public function setNonce($nonce) { $this->nonce = $nonce; + return $this; } @@ -320,19 +351,20 @@ class Session /** * Set created * - * @param datetime $created + * @param \DateTime $created * @return Session */ public function setCreated($created) { $this->created = $created; + return $this; } /** * Get created * - * @return datetime + * @return \DateTime */ public function getCreated() { @@ -342,50 +374,53 @@ class Session /** * Set updated * - * @param datetime $updated + * @param \DateTime $updated * @return Session */ public function setUpdated($updated) { $this->updated = $updated; + return $this; } /** * Get updated * - * @return datetime + * @return \DateTime */ public function getUpdated() { return $this->updated; } - /** - * @var \Doctrine\Common\Collections\ArrayCollection - */ - private $modules; - - public function __construct() - { - $this->modules = new \Doctrine\Common\Collections\ArrayCollection(); - } /** * Add modules * - * @param Entities\SessionModule $modules + * @param \Entities\SessionModule $modules * @return Session */ - public function addSessionModule(\Entities\SessionModule $modules) + public function addModule(\Entities\SessionModule $modules) { $this->modules[] = $modules; + return $this; } + /** + * Remove modules + * + * @param \Entities\SessionModule $modules + */ + public function removeModule(\Entities\SessionModule $modules) + { + $this->modules->removeElement($modules); + } + /** * Get modules * - * @return Doctrine\Common\Collections\Collection + * @return \Doctrine\Common\Collections\Collection */ public function getModules() { @@ -395,8 +430,8 @@ class Session /** * Get a module by its identifier * - * @param integer $moduleId - * @return Entities\SessionModule|null + * @param integer $moduleId + * @return Entities\SessionModule|null */ public function getModuleById($moduleId) { @@ -419,27 +454,4 @@ class Session return false; } - - /** - * Add modules - * - * @param \Entities\SessionModule $modules - * @return Session - */ - public function addModule(\Entities\SessionModule $modules) - { - $this->modules[] = $modules; - - return $this; - } - - /** - * Remove modules - * - * @param \Entities\SessionModule $modules - */ - public function removeModule(\Entities\SessionModule $modules) - { - $this->modules->removeElement($modules); - } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/SessionModule.php b/lib/Doctrine/Entities/SessionModule.php index 3e6c253b85..4422fa6ede 100644 --- a/lib/Doctrine/Entities/SessionModule.php +++ b/lib/Doctrine/Entities/SessionModule.php @@ -1,44 +1,52 @@ module_id = $moduleId; + return $this; } /** * Get module_id * - * @return integer + * @return integer */ public function getModuleId() { @@ -70,19 +79,20 @@ class SessionModule /** * Set created * - * @param datetime $created + * @param \DateTime $created * @return SessionModule */ public function setCreated($created) { $this->created = $created; + return $this; } /** * Get created * - * @return datetime + * @return \DateTime */ public function getCreated() { @@ -92,19 +102,20 @@ class SessionModule /** * Set updated * - * @param datetime $updated + * @param \DateTime $updated * @return SessionModule */ public function setUpdated($updated) { $this->updated = $updated; + return $this; } /** * Get updated * - * @return datetime + * @return \DateTime */ public function getUpdated() { @@ -114,22 +125,23 @@ class SessionModule /** * Set session * - * @param Entities\Session $session + * @param \Entities\Session $session * @return SessionModule */ public function setSession(\Entities\Session $session = null) { $this->session = $session; + return $this; } /** * Get session * - * @return Entities\Session + * @return \Entities\Session */ public function getSession() { return $this->session; } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/StoryWZ.php b/lib/Doctrine/Entities/StoryWZ.php index 48b150c2a8..7382f6faae 100644 --- a/lib/Doctrine/Entities/StoryWZ.php +++ b/lib/Doctrine/Entities/StoryWZ.php @@ -14,36 +14,34 @@ namespace Entities; use Alchemy\Phrasea\Application; /** - * - * @license http://opensource.org/licenses/gpl-3.0 GPLv3 - * @link www.phraseanet.com + * StoryWZ */ class StoryWZ { /** - * @var integer $id + * @var integer */ - protected $id; + private $id; /** - * @var integer $sbas_id + * @var integer */ - protected $sbas_id; + private $sbas_id; /** - * @var integer $record_id + * @var integer */ - protected $record_id; + private $record_id; /** - * @var integer $usr_id + * @var integer */ - protected $usr_id; + private $usr_id; /** - * @var datetime $created + * @var \DateTime */ - protected $created; + private $created; /** * Get id @@ -58,11 +56,14 @@ class StoryWZ /** * Set sbas_id * - * @param integer $sbasId + * @param integer $sbasId + * @return StoryWZ */ public function setSbasId($sbasId) { $this->sbas_id = $sbasId; + + return $this; } /** @@ -78,11 +79,14 @@ class StoryWZ /** * Set record_id * - * @param integer $recordId + * @param integer $recordId + * @return StoryWZ */ public function setRecordId($recordId) { $this->record_id = $recordId; + + return $this; } /** @@ -95,14 +99,28 @@ class StoryWZ return $this->record_id; } + public function getRecord(Application $app) + { + return new \record_adapter($app, $this->getSbasId(), $this->getRecordId()); + } + + public function setRecord(\record_adapter $record) + { + $this->setRecordId($record->get_record_id()); + $this->setSbasId($record->get_sbas_id()); + } + /** * Set usr_id * - * @param integer $usrId + * @param integer $usrId + * @return StoryWZ */ public function setUsrId($usrId) { $this->usr_id = $usrId; + + return $this; } /** @@ -115,26 +133,6 @@ class StoryWZ return $this->usr_id; } - /** - * Set created - * - * @param datetime $created - */ - public function setCreated($created) - { - $this->created = $created; - } - - /** - * Get created - * - * @return datetime - */ - public function getCreated() - { - return $this->created; - } - public function setUser(\User_Adapter $user) { $this->setUsrId($user->get_id()); @@ -147,14 +145,26 @@ class StoryWZ } } - public function getRecord(Application $app) + /** + * Set created + * + * @param \DateTime $created + * @return StoryWZ + */ + public function setCreated($created) { - return new \record_adapter($app, $this->getSbasId(), $this->getRecordId()); + $this->created = $created; + + return $this; } - public function setRecord(\record_adapter $record) + /** + * Get created + * + * @return \DateTime + */ + public function getCreated() { - $this->setRecordId($record->get_record_id()); - $this->setSbasId($record->get_sbas_id()); + return $this->created; } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/UsrAuthProvider.php b/lib/Doctrine/Entities/UsrAuthProvider.php index 10dc1185d0..88d3b7cb0d 100644 --- a/lib/Doctrine/Entities/UsrAuthProvider.php +++ b/lib/Doctrine/Entities/UsrAuthProvider.php @@ -3,7 +3,6 @@ namespace Entities; use Alchemy\Phrasea\Application; -use Doctrine\ORM\Mapping as ORM; /** * UsrAuthProvider @@ -25,6 +24,11 @@ class UsrAuthProvider */ private $provider; + /** + * @var string + */ + private $distant_id; + /** * @var \DateTime */ @@ -35,12 +39,6 @@ class UsrAuthProvider */ private $created; - /** - * @var string - */ - private $distant_id; - - /** * Get id * @@ -54,7 +52,7 @@ class UsrAuthProvider /** * Set usr_id * - * @param integer $usrId + * @param integer $usrId * @return UsrAuthProvider */ public function setUsrId($usrId) @@ -82,7 +80,7 @@ class UsrAuthProvider /** * Set provider * - * @param string $provider + * @param string $provider * @return UsrAuthProvider */ public function setProvider($provider) @@ -102,10 +100,33 @@ class UsrAuthProvider return $this->provider; } + /** + * Set distant_id + * + * @param string $distantId + * @return UsrAuthProvider + */ + public function setDistantId($distantId) + { + $this->distant_id = $distantId; + + return $this; + } + + /** + * Get distant_id + * + * @return string + */ + public function getDistantId() + { + return $this->distant_id; + } + /** * Set updated * - * @param \DateTime $updated + * @param \DateTime $updated * @return UsrAuthProvider */ public function setUpdated($updated) @@ -128,7 +149,7 @@ class UsrAuthProvider /** * Set created * - * @param \DateTime $created + * @param \DateTime $created * @return UsrAuthProvider */ public function setCreated($created) @@ -147,27 +168,4 @@ class UsrAuthProvider { return $this->created; } - - /** - * Set distant_id - * - * @param string $distantId - * @return UsrAuthProvider - */ - public function setDistantId($distantId) - { - $this->distant_id = $distantId; - - return $this; - } - - /** - * Get distant_id - * - * @return string - */ - public function getDistantId() - { - return $this->distant_id; - } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/UsrList.php b/lib/Doctrine/Entities/UsrList.php index c0ecf8590b..f3d27cdc04 100644 --- a/lib/Doctrine/Entities/UsrList.php +++ b/lib/Doctrine/Entities/UsrList.php @@ -14,42 +14,43 @@ namespace Entities; use Alchemy\Phrasea\Application; /** - * - * @license http://opensource.org/licenses/gpl-3.0 GPLv3 - * @link www.phraseanet.com + * UsrList */ class UsrList { /** - * @var integer $id + * @var integer */ - protected $id; + private $id; /** - * @var string $name + * @var string */ - protected $name; + private $name; /** - * @var datetime $created + * @var \DateTime */ - protected $created; + private $created; /** - * @var datetime $updated + * @var \DateTime */ - protected $updated; - - /** - * @var Entities\UsrListOwner - */ - protected $owners; + private $updated; /** * @var \Doctrine\Common\Collections\Collection */ - protected $entries; + private $owners; + /** + * @var \Doctrine\Common\Collections\Collection + */ + private $entries; + + /** + * Constructor + */ public function __construct() { $this->owners = new \Doctrine\Common\Collections\ArrayCollection(); @@ -69,11 +70,14 @@ class UsrList /** * Set name * - * @param string $name + * @param string $name + * @return UsrList */ public function setName($name) { $this->name = $name; + + return $this; } /** @@ -89,17 +93,20 @@ class UsrList /** * Set created * - * @param datetime $created + * @param \DateTime $created + * @return UsrList */ public function setCreated($created) { $this->created = $created; + + return $this; } /** * Get created * - * @return datetime + * @return \DateTime */ public function getCreated() { @@ -109,17 +116,20 @@ class UsrList /** * Set updated * - * @param datetime $updated + * @param \DateTime $updated + * @return UsrList */ public function setUpdated($updated) { $this->updated = $updated; + + return $this; } /** * Get updated * - * @return datetime + * @return \DateTime */ public function getUpdated() { @@ -129,23 +139,69 @@ class UsrList /** * Add owners * - * @param Entities\UsrListOwner $owners + * @param \Entities\UsrListOwner $owners + * @return UsrList */ - public function addUsrListOwner(\Entities\UsrListOwner $owners) + public function addOwner(\Entities\UsrListOwner $owners) { $this->owners[] = $owners; + + return $this; + } + + /** + * Remove owners + * + * @param \Entities\UsrListOwner $owners + */ + public function removeOwner(\Entities\UsrListOwner $owners) + { + $this->owners->removeElement($owners); } /** * Get owners * - * @return Doctrine\Common\Collections\Collection + * @return \Doctrine\Common\Collections\Collection */ public function getOwners() { return $this->owners; } + /** + * Add entries + * + * @param \Entities\UsrListEntry $entries + * @return UsrList + */ + public function addEntrie(\Entities\UsrListEntry $entries) + { + $this->entries[] = $entries; + + return $this; + } + + /** + * Remove entries + * + * @param \Entities\UsrListEntry $entries + */ + public function removeEntrie(\Entities\UsrListEntry $entries) + { + $this->entries->removeElement($entries); + } + + /** + * Get entries + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getEntries() + { + return $this->entries; + } + public function hasAccess(\User_Adapter $user, Application $app) { foreach ($this->getOwners() as $owner) { @@ -173,26 +229,6 @@ class UsrList throw new \Exception('This user is not an owner of the list'); } - /** - * Add entry - * - * @param Entities\UsrListEntry $entry - */ - public function addUsrListEntry(\Entities\UsrListEntry $entry) - { - $this->entries[] = $entry; - } - - /** - * Get entries - * - * @return \Doctrine\Common\Collections\Collection - */ - public function getEntries() - { - return $this->entries; - } - /** * Return true if one of the entry is related to the given user * @@ -202,55 +238,9 @@ class UsrList public function has(\User_Adapter $user, Application $app) { return $this->entries->exists( - function($key, $entry) use ($user) { - return $entry->getUser($app)->get_id() === $user->get_id(); - } + function($key, $entry) use ($user) { + return $entry->getUser($app)->get_id() === $user->get_id(); + } ); } - - /** - * Add owners - * - * @param \Entities\UsrListOwner $owners - * @return UsrList - */ - public function addOwner(\Entities\UsrListOwner $owners) - { - $this->owners[] = $owners; - - return $this; - } - - /** - * Remove owners - * - * @param \Entities\UsrListOwner $owners - */ - public function removeOwner(\Entities\UsrListOwner $owners) - { - $this->owners->removeElement($owners); - } - - /** - * Add entries - * - * @param \Entities\UsrListEntry $entries - * @return UsrList - */ - public function addEntrie(\Entities\UsrListEntry $entries) - { - $this->entries[] = $entries; - - return $this; - } - - /** - * Remove entries - * - * @param \Entities\UsrListEntry $entries - */ - public function removeEntrie(\Entities\UsrListEntry $entries) - { - $this->entries->removeElement($entries); - } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/UsrListEntry.php b/lib/Doctrine/Entities/UsrListEntry.php index 0cecc0e0c9..56d270fab1 100644 --- a/lib/Doctrine/Entities/UsrListEntry.php +++ b/lib/Doctrine/Entities/UsrListEntry.php @@ -14,36 +14,34 @@ namespace Entities; use Alchemy\Phrasea\Application; /** - * - * @license http://opensource.org/licenses/gpl-3.0 GPLv3 - * @link www.phraseanet.com + * UsrListEntry */ class UsrListEntry { /** - * @var integer $id + * @var integer */ - protected $id; + private $id; /** - * @var integer $usr_id + * @var integer */ - protected $usr_id; + private $usr_id; /** - * @var datetime $created + * @var \DateTime */ - protected $created; + private $created; /** - * @var datetime $updated + * @var \DateTime */ - protected $updated; + private $updated; /** - * @var Entities\UsrList + * @var \Entities\UsrList */ - protected $list; + private $list; /** * Get id @@ -58,11 +56,14 @@ class UsrListEntry /** * Set usr_id * - * @param integer $usrId + * @param integer $usrId + * @return UsrListEntry */ public function setUsrId($usrId) { $this->usr_id = $usrId; + + return $this; } /** @@ -75,66 +76,6 @@ class UsrListEntry return $this->usr_id; } - /** - * Set created - * - * @param datetime $created - */ - public function setCreated($created) - { - $this->created = $created; - } - - /** - * Get created - * - * @return datetime - */ - public function getCreated() - { - return $this->created; - } - - /** - * Set updated - * - * @param datetime $updated - */ - public function setUpdated($updated) - { - $this->updated = $updated; - } - - /** - * Get updated - * - * @return datetime - */ - public function getUpdated() - { - return $this->updated; - } - - /** - * Set list - * - * @param Entities\UsrList $list - */ - public function setList(\Entities\UsrList $list) - { - $this->list = $list; - } - - /** - * Get list - * - * @return Entities\UsrList - */ - public function getList() - { - return $this->list; - } - public function getUser(Application $app) { return \User_Adapter::getInstance($this->getUsrId(), $app); @@ -144,4 +85,73 @@ class UsrListEntry { return $this->setUsrId($user->get_id()); } -} \ No newline at end of file + + /** + * Set created + * + * @param \DateTime $created + * @return UsrListEntry + */ + public function setCreated($created) + { + $this->created = $created; + + return $this; + } + + /** + * Get created + * + * @return \DateTime + */ + public function getCreated() + { + return $this->created; + } + + /** + * Set updated + * + * @param \DateTime $updated + * @return UsrListEntry + */ + public function setUpdated($updated) + { + $this->updated = $updated; + + return $this; + } + + /** + * Get updated + * + * @return \DateTime + */ + public function getUpdated() + { + return $this->updated; + } + + /** + * Set list + * + * @param \Entities\UsrList $list + * @return UsrListEntry + */ + public function setList(\Entities\UsrList $list = null) + { + $this->list = $list; + + return $this; + } + + /** + * Get list + * + * @return \Entities\UsrList + */ + public function getList() + { + return $this->list; + } +} diff --git a/lib/Doctrine/Entities/UsrListOwner.php b/lib/Doctrine/Entities/UsrListOwner.php index 5aed8d4420..2aae123dc0 100644 --- a/lib/Doctrine/Entities/UsrListOwner.php +++ b/lib/Doctrine/Entities/UsrListOwner.php @@ -14,9 +14,7 @@ namespace Entities; use Alchemy\Phrasea\Application; /** - * - * @license http://opensource.org/licenses/gpl-3.0 GPLv3 - * @link www.phraseanet.com + * UsrListOwner */ class UsrListOwner { @@ -25,34 +23,34 @@ class UsrListOwner const ROLE_ADMIN = 3; /** - * @var integer $id + * @var integer */ - protected $id; + private $id; /** - * @var integer $usr_id + * @var integer */ - protected $usr_id; + private $usr_id; /** - * @var string $role + * @var string */ - protected $role; + private $role; /** - * @var datetime $created + * @var \DateTime */ - protected $created; + private $created; /** - * @var datetime $updated + * @var \DateTime */ - protected $updated; + private $updated; /** - * @var Entities\UsrList + * @var \Entities\UsrList */ - protected $list; + private $list; /** * Get id @@ -67,11 +65,14 @@ class UsrListOwner /** * Set usr_id * - * @param integer $usrId + * @param integer $usrId + * @return UsrListOwner */ public function setUsrId($usrId) { $this->usr_id = $usrId; + + return $this; } /** @@ -84,10 +85,21 @@ class UsrListOwner return $this->usr_id; } + public function setUser(\User_Adapter $user) + { + return $this->setUsrId($user->get_id()); + } + + public function getUser(Application $app) + { + return \User_Adapter::getInstance($this->getUsrId(), $app); + } + /** * Set role * - * @param string $role + * @param string $role + * @return UsrListOwner */ public function setRole($role) { @@ -95,6 +107,8 @@ class UsrListOwner throw new \Exception('Unknown role `' . $role . '`'); $this->role = $role; + + return $this; } /** @@ -110,17 +124,20 @@ class UsrListOwner /** * Set created * - * @param datetime $created + * @param \DateTime $created + * @return UsrListOwner */ public function setCreated($created) { $this->created = $created; + + return $this; } /** * Get created * - * @return datetime + * @return \DateTime */ public function getCreated() { @@ -130,17 +147,20 @@ class UsrListOwner /** * Set updated * - * @param datetime $updated + * @param \DateTime $updated + * @return UsrListOwner */ public function setUpdated($updated) { $this->updated = $updated; + + return $this; } /** * Get updated * - * @return datetime + * @return \DateTime */ public function getUpdated() { @@ -150,30 +170,23 @@ class UsrListOwner /** * Set list * - * @param Entities\UsrList $list + * @param \Entities\UsrList $list + * @return UsrListOwner */ - public function setList(\Entities\UsrList $list) + public function setList(\Entities\UsrList $list = null) { $this->list = $list; + + return $this; } /** * Get list * - * @return Entities\UsrList + * @return \Entities\UsrList */ public function getList() { return $this->list; } - - public function setUser(\User_Adapter $user) - { - return $this->setUsrId($user->get_id()); - } - - public function getUser(Application $app) - { - return \User_Adapter::getInstance($this->getUsrId(), $app); - } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/ValidationData.php b/lib/Doctrine/Entities/ValidationData.php index 3d3a4bda55..64474e687c 100644 --- a/lib/Doctrine/Entities/ValidationData.php +++ b/lib/Doctrine/Entities/ValidationData.php @@ -11,42 +11,42 @@ namespace Entities; +use Alchemy\Phrasea\Application; + /** - * - * @license http://opensource.org/licenses/gpl-3.0 GPLv3 - * @link www.phraseanet.com + * ValidationData */ class ValidationData { /** - * @var integer $id + * @var integer */ - protected $id; + private $id; /** - * @var boolean $agreement + * @var boolean */ - protected $agreement; + private $agreement; /** - * @var text $note + * @var string */ - protected $note; + private $note; /** - * @var datetime $updated + * @var \DateTime */ - protected $updated; + private $updated; /** - * @var Entities\ValidationParticipant + * @var \Entities\ValidationParticipant */ - protected $participant; + private $participant; /** - * @var Entities\BasketElement + * @var \Entities\BasketElement */ - protected $basket_element; + private $basket_element; /** * Get id @@ -61,11 +61,14 @@ class ValidationData /** * Set agreement * - * @param boolean $agreement + * @param boolean $agreement + * @return ValidationData */ public function setAgreement($agreement) { $this->agreement = $agreement; + + return $this; } /** @@ -81,17 +84,20 @@ class ValidationData /** * Set note * - * @param text $note + * @param string $note + * @return ValidationData */ public function setNote($note) { $this->note = $note; + + return $this; } /** * Get note * - * @return text + * @return string */ public function getNote() { @@ -101,17 +107,20 @@ class ValidationData /** * Set updated * - * @param datetime $updated + * @param \DateTime $updated + * @return ValidationData */ public function setUpdated($updated) { $this->updated = $updated; + + return $this; } /** * Get updated * - * @return datetime + * @return \DateTime */ public function getUpdated() { @@ -121,17 +130,20 @@ class ValidationData /** * Set participant * - * @param Entities\ValidationParticipant $participant + * @param \Entities\ValidationParticipant $participant + * @return ValidationData */ - public function setParticipant(\Entities\ValidationParticipant $participant) + public function setParticipant(\Entities\ValidationParticipant $participant = null) { $this->participant = $participant; + + return $this; } /** * Get participant * - * @return Entities\ValidationParticipant + * @return \Entities\ValidationParticipant */ public function getParticipant() { @@ -141,20 +153,23 @@ class ValidationData /** * Set basket_element * - * @param Entities\BasketElement $basketElement + * @param \Entities\BasketElement $basketElement + * @return ValidationData */ - public function setBasketElement(\Entities\BasketElement $basketElement) + public function setBasketElement(\Entities\BasketElement $basketElement = null) { $this->basket_element = $basketElement; + + return $this; } /** * Get basket_element * - * @return Entities\BasketElement + * @return \Entities\BasketElement */ public function getBasketElement() { return $this->basket_element; } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/ValidationParticipant.php b/lib/Doctrine/Entities/ValidationParticipant.php index 8bb77b1033..c21e84a85c 100644 --- a/lib/Doctrine/Entities/ValidationParticipant.php +++ b/lib/Doctrine/Entities/ValidationParticipant.php @@ -14,57 +14,58 @@ namespace Entities; use Alchemy\Phrasea\Application; /** - * - * @license http://opensource.org/licenses/gpl-3.0 GPLv3 - * @link www.phraseanet.com + * ValidationParticipant */ class ValidationParticipant { /** - * @var integer $id + * @var integer */ - protected $id; + private $id; /** - * @var integer $usr_id + * @var integer */ - protected $usr_id; + private $usr_id; /** - * @var Entities\ValidationSession + * @var boolean */ - protected $session; + private $is_aware = false; /** - * @var datetime $reminded + * @var boolean */ - protected $reminded = null; + private $is_confirmed = false; /** - * @var Entities\ValidationData + * @var boolean */ - protected $datas; + private $can_agree = false; /** - * @var boolean $is_confirmed + * @var boolean */ - protected $is_confirmed = false; + private $can_see_others = false; /** - * @var boolean $can_agree + * @var \DateTime */ - protected $can_agree = false; + private $reminded; /** - * @var boolean $can_see_others + * @var \Doctrine\Common\Collections\Collection */ - protected $can_see_others = false; + private $datas; /** - * @var boolean $is_aware + * @var \Entities\ValidationSession */ - protected $is_aware = false; + private $session; + /** + * Constructor + */ public function __construct() { $this->datas = new \Doctrine\Common\Collections\ArrayCollection(); @@ -83,11 +84,14 @@ class ValidationParticipant /** * Set usr_id * - * @param integer $usrId + * @param integer $usrId + * @return ValidationParticipant */ public function setUsrId($usrId) { $this->usr_id = $usrId; + + return $this; } /** @@ -100,56 +104,6 @@ class ValidationParticipant return $this->usr_id; } - /** - * Add datases - * - * @param Entities\ValidationData $datas - */ - public function addValidationData(\Entities\ValidationData $datas) - { - $this->datas[] = $datas; - } - - /** - * Set session - * - * @param Entities\ValidationSession $session - */ - public function setSession(\Entities\ValidationSession $session) - { - $this->session = $session; - } - - /** - * Get session - * - * @return Entities\ValidationSession - */ - public function getSession() - { - return $this->session; - } - - /** - * Set is_aware - * - * @param boolean $isAware - */ - public function setIsAware($isAware) - { - $this->is_aware = $isAware; - } - - /** - * Get is_aware - * - * @return boolean - */ - public function getIsAware() - { - return $this->is_aware; - } - /** * * @param \User_Adapter $user @@ -168,43 +122,39 @@ class ValidationParticipant } /** - * Set reminded + * Set is_aware * - * @param datetime $reminded + * @param boolean $isAware + * @return ValidationParticipant */ - public function setReminded($reminded) + public function setIsAware($isAware) { - $this->reminded = $reminded; + $this->is_aware = $isAware; + + return $this; } /** - * Get reminded + * Get is_aware * - * @return datetime + * @return boolean */ - public function getReminded() + public function getIsAware() { - return $this->reminded; - } - - /** - * Get datas - * - * @return Doctrine\Common\Collections\Collection - */ - public function getDatas() - { - return $this->datas; + return $this->is_aware; } /** * Set is_confirmed * - * @param boolean $isConfirmed + * @param boolean $isConfirmed + * @return ValidationParticipant */ public function setIsConfirmed($isConfirmed) { $this->is_confirmed = $isConfirmed; + + return $this; } /** @@ -220,11 +170,14 @@ class ValidationParticipant /** * Set can_agree * - * @param boolean $canAgree + * @param boolean $canAgree + * @return ValidationParticipant */ public function setCanAgree($canAgree) { $this->can_agree = $canAgree; + + return $this; } /** @@ -240,11 +193,14 @@ class ValidationParticipant /** * Set can_see_others * - * @param boolean $canSeeOthers + * @param boolean $canSeeOthers + * @return ValidationParticipant */ public function setCanSeeOthers($canSeeOthers) { $this->can_see_others = $canSeeOthers; + + return $this; } /** @@ -257,6 +213,85 @@ class ValidationParticipant return $this->can_see_others; } + /** + * Set reminded + * + * @param \DateTime $reminded + * @return ValidationParticipant + */ + public function setReminded($reminded) + { + $this->reminded = $reminded; + + return $this; + } + + /** + * Get reminded + * + * @return \DateTime + */ + public function getReminded() + { + return $this->reminded; + } + + /** + * Add datas + * + * @param \Entities\ValidationData $datas + * @return ValidationParticipant + */ + public function addData(\Entities\ValidationData $datas) + { + $this->datas[] = $datas; + + return $this; + } + + /** + * Remove datas + * + * @param \Entities\ValidationData $datas + */ + public function removeData(\Entities\ValidationData $datas) + { + $this->datas->removeElement($datas); + } + + /** + * Get datas + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getDatas() + { + return $this->datas; + } + + /** + * Set session + * + * @param \Entities\ValidationSession $session + * @return ValidationParticipant + */ + public function setSession(\Entities\ValidationSession $session = null) + { + $this->session = $session; + + return $this; + } + + /** + * Get session + * + * @return \Entities\ValidationSession + */ + public function getSession() + { + return $this->session; + } + public function isReleasable() { @@ -273,27 +308,4 @@ class ValidationParticipant return true; } - - /** - * Add datas - * - * @param \Entities\ValidationData $datas - * @return ValidationParticipant - */ - public function addData(\Entities\ValidationData $datas) - { - $this->datas[] = $datas; - - return $this; - } - - /** - * Remove datas - * - * @param \Entities\ValidationData $datas - */ - public function removeData(\Entities\ValidationData $datas) - { - $this->datas->removeElement($datas); - } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Entities/ValidationSession.php b/lib/Doctrine/Entities/ValidationSession.php index 0282985a06..f0c4667ac0 100644 --- a/lib/Doctrine/Entities/ValidationSession.php +++ b/lib/Doctrine/Entities/ValidationSession.php @@ -15,63 +15,48 @@ use Alchemy\Phrasea\Application; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Kernel - * - * @license http://opensource.org/licenses/gpl-3.0 GPLv3 - * @link www.phraseanet.com + * ValidationSession */ class ValidationSession { /** - * @var integer $id + * @var integer */ - protected $id; + private $id; /** - * @var string $name + * @var integer */ - protected $name; + private $initiator_id; /** - * @var text $description + * @var \DateTime */ - protected $description; + private $created; /** - * @var boolean $archived + * @var \DateTime */ - protected $archived; + private $updated; /** - * @var datetime $created + * @var \DateTime */ - protected $created; + private $expires; /** - * @var datetime $updated + * @var \Entities\Basket */ - protected $updated; + private $basket; /** - * @var datetime $expires + * @var \Doctrine\Common\Collections\Collection */ - protected $expires; + private $participants; /** - * @var datetime $reminded + * Constructor */ - protected $reminded; - - /** - * @var Entities\Basket - */ - protected $basket; - - /** - * @var Entities\ValidationParticipant - */ - protected $participants; - public function __construct() { $this->participants = new \Doctrine\Common\Collections\ArrayCollection(); @@ -87,219 +72,17 @@ class ValidationSession return $this->id; } - /** - * Set name - * - * @param string $name - */ - public function setName($name) - { - $this->name = $name; - } - - /** - * Get name - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Set description - * - * @param text $description - */ - public function setDescription($description) - { - $this->description = $description; - } - - /** - * Get description - * - * @return text - */ - public function getDescription() - { - return $this->description; - } - - /** - * Set archived - * - * @param boolean $archived - */ - public function setArchived($archived) - { - $this->archived = $archived; - } - - /** - * Get archived - * - * @return boolean - */ - public function getArchived() - { - return $this->archived; - } - - /** - * Set created - * - * @param datetime $created - */ - public function setCreated($created) - { - $this->created = $created; - } - - /** - * Get created - * - * @return datetime - */ - public function getCreated() - { - return $this->created; - } - - /** - * Set updated - * - * @param datetime $updated - */ - public function setUpdated($updated) - { - $this->updated = $updated; - } - - /** - * Get updated - * - * @return datetime - */ - public function getUpdated() - { - return $this->updated; - } - - /** - * Set expires - * - * @param datetime $expires - */ - public function setExpires($expires) - { - $this->expires = $expires; - } - - /** - * Get expires - * - * @return datetime - */ - public function getExpires() - { - return $this->expires; - } - - /** - * Set reminded - * - * @param datetime $reminded - */ - public function setReminded($reminded) - { - $this->reminded = $reminded; - } - - /** - * Get reminded - * - * @return datetime - */ - public function getReminded() - { - return $this->reminded; - } - - /** - * Set basket - * - * @param Entities\Basket $basket - */ - public function setBasket(\Entities\Basket $basket) - { - $this->basket = $basket; - } - - /** - * Get basket - * - * @return Entities\Basket - */ - public function getBasket() - { - return $this->basket; - } - - /** - * Add participants - * - * @param Entities\ValidationParticipant $participants - */ - public function addValidationParticipant(\Entities\ValidationParticipant $participants) - { - $this->participants[] = $participants; - } - - /** - * Get participants - * - * @return Doctrine\Common\Collections\Collection - */ - public function getParticipants() - { - return $this->participants; - } - - /** - * Get a participant - * - * @return Entities\ValidationParticipant - */ - public function getParticipant(\User_Adapter $user, Application $app) - { - foreach ($this->getParticipants() as $participant) { - if ($participant->getUser($app)->get_id() == $user->get_id()) { - return $participant; - } - } - - throw new NotFoundHttpException('Particpant not found' . $user->get_email()); - } - /** - * @var integer $initiator - */ - protected $initiator; - - /** - * @var integer $initiator_id - */ - protected $initiator_id; - /** * Set initiator_id * - * @param integer $initiatorId + * @param integer $initiatorId + * @return ValidationSession */ public function setInitiatorId($initiatorId) { $this->initiator_id = $initiatorId; + + return $this; } /** @@ -331,6 +114,131 @@ class ValidationSession } } + /** + * Set created + * + * @param \DateTime $created + * @return ValidationSession + */ + public function setCreated($created) + { + $this->created = $created; + + return $this; + } + + /** + * Get created + * + * @return \DateTime + */ + public function getCreated() + { + return $this->created; + } + + /** + * Set updated + * + * @param \DateTime $updated + * @return ValidationSession + */ + public function setUpdated($updated) + { + $this->updated = $updated; + + return $this; + } + + /** + * Get updated + * + * @return \DateTime + */ + public function getUpdated() + { + return $this->updated; + } + + /** + * Set expires + * + * @param \DateTime $expires + * @return ValidationSession + */ + public function setExpires($expires) + { + $this->expires = $expires; + + return $this; + } + + /** + * Get expires + * + * @return \DateTime + */ + public function getExpires() + { + return $this->expires; + } + + /** + * Set basket + * + * @param \Entities\Basket $basket + * @return ValidationSession + */ + public function setBasket(\Entities\Basket $basket = null) + { + $this->basket = $basket; + + return $this; + } + + /** + * Get basket + * + * @return \Entities\Basket + */ + public function getBasket() + { + return $this->basket; + } + + /** + * Add participants + * + * @param \Entities\ValidationParticipant $participants + * @return ValidationSession + */ + public function addParticipant(\Entities\ValidationParticipant $participants) + { + $this->participants[] = $participants; + + return $this; + } + + /** + * Remove participants + * + * @param \Entities\ValidationParticipant $participants + */ + public function removeParticipant(\Entities\ValidationParticipant $participants) + { + $this->participants->removeElement($participants); + } + + /** + * Get participants + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getParticipants() + { + return $this->participants; + } + public function isFinished() { if (is_null($this->getExpires())) { @@ -373,25 +281,18 @@ class ValidationSession } /** - * Add participants + * Get a participant * - * @param \Entities\ValidationParticipant $participants - * @return ValidationSession + * @return Entities\ValidationParticipant */ - public function addParticipant(\Entities\ValidationParticipant $participants) + public function getParticipant(\User_Adapter $user, Application $app) { - $this->participants[] = $participants; + foreach ($this->getParticipants() as $participant) { + if ($participant->getUser($app)->get_id() == $user->get_id()) { + return $participant; + } + } - return $this; + throw new NotFoundHttpException('Particpant not found' . $user->get_email()); } - - /** - * Remove participants - * - * @param \Entities\ValidationParticipant $participants - */ - public function removeParticipant(\Entities\ValidationParticipant $participants) - { - $this->participants->removeElement($participants); - } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Proxies/__CG__EntitiesAuthFailure.php b/lib/Doctrine/Proxies/__CG__EntitiesAuthFailure.php new file mode 100644 index 0000000000..95a9c64142 --- /dev/null +++ b/lib/Doctrine/Proxies/__CG__EntitiesAuthFailure.php @@ -0,0 +1,124 @@ +_entityPersister = $entityPersister; + $this->_identifier = $identifier; + } + /** @private */ + public function __load() + { + if (!$this->__isInitialized__ && $this->_entityPersister) { + $this->__isInitialized__ = true; + + if (method_exists($this, "__wakeup")) { + // call this after __isInitialized__to avoid infinite recursion + // but before loading to emulate what ClassMetadata::newInstance() + // provides. + $this->__wakeup(); + } + + if ($this->_entityPersister->load($this->_identifier, $this) === null) { + throw new \Doctrine\ORM\EntityNotFoundException(); + } + unset($this->_entityPersister, $this->_identifier); + } + } + + /** @private */ + public function __isInitialized() + { + return $this->__isInitialized__; + } + + + public function getId() + { + if ($this->__isInitialized__ === false) { + return (int) $this->_identifier["id"]; + } + $this->__load(); + return parent::getId(); + } + + public function setUsername($username) + { + $this->__load(); + return parent::setUsername($username); + } + + public function getUsername() + { + $this->__load(); + return parent::getUsername(); + } + + public function setIp($ip) + { + $this->__load(); + return parent::setIp($ip); + } + + public function getIp() + { + $this->__load(); + return parent::getIp(); + } + + public function setLocked($locked) + { + $this->__load(); + return parent::setLocked($locked); + } + + public function getLocked() + { + $this->__load(); + return parent::getLocked(); + } + + public function setCreated($created) + { + $this->__load(); + return parent::setCreated($created); + } + + public function getCreated() + { + $this->__load(); + return parent::getCreated(); + } + + + public function __sleep() + { + return array('__isInitialized__', 'id', 'username', 'ip', 'locked', 'created'); + } + + public function __clone() + { + if (!$this->__isInitialized__ && $this->_entityPersister) { + $this->__isInitialized__ = true; + $class = $this->_entityPersister->getClassMetadata(); + $original = $this->_entityPersister->load($this->_identifier); + if ($original === null) { + throw new \Doctrine\ORM\EntityNotFoundException(); + } + foreach ($class->reflFields as $field => $reflProperty) { + $reflProperty->setValue($this, $reflProperty->getValue($original)); + } + unset($this->_entityPersister, $this->_identifier); + } + + } +} \ No newline at end of file diff --git a/lib/Doctrine/Proxies/__CG__EntitiesBasket.php b/lib/Doctrine/Proxies/__CG__EntitiesBasket.php index 78e4266f19..bc7b279947 100644 --- a/lib/Doctrine/Proxies/__CG__EntitiesBasket.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesBasket.php @@ -87,6 +87,30 @@ class Basket extends \Entities\Basket implements \Doctrine\ORM\Proxy\Proxy return parent::getUsrId(); } + public function setOwner(\User_Adapter $user) + { + $this->__load(); + return parent::setOwner($user); + } + + public function getOwner(\Alchemy\Phrasea\Application $app) + { + $this->__load(); + return parent::getOwner($app); + } + + public function setIsRead($isRead) + { + $this->__load(); + return parent::setIsRead($isRead); + } + + public function getIsRead() + { + $this->__load(); + return parent::getIsRead(); + } + public function setPusherId($pusherId) { $this->__load(); @@ -99,6 +123,18 @@ class Basket extends \Entities\Basket implements \Doctrine\ORM\Proxy\Proxy return parent::getPusherId(); } + public function setPusher(\User_Adapter $user) + { + $this->__load(); + return parent::setPusher($user); + } + + public function getPusher(\Alchemy\Phrasea\Application $app) + { + $this->__load(); + return parent::getPusher($app); + } + public function setArchived($archived) { $this->__load(); @@ -135,10 +171,28 @@ class Basket extends \Entities\Basket implements \Doctrine\ORM\Proxy\Proxy return parent::getUpdated(); } - public function addBasketElement(\Entities\BasketElement $elements) + public function setValidation(\Entities\ValidationSession $validation = NULL) { $this->__load(); - return parent::addBasketElement($elements); + return parent::setValidation($validation); + } + + public function getValidation() + { + $this->__load(); + return parent::getValidation(); + } + + public function addElement(\Entities\BasketElement $elements) + { + $this->__load(); + return parent::addElement($elements); + } + + public function removeElement(\Entities\BasketElement $elements) + { + $this->__load(); + return parent::removeElement($elements); } public function getElements() @@ -153,54 +207,6 @@ class Basket extends \Entities\Basket implements \Doctrine\ORM\Proxy\Proxy return parent::getElementsByOrder($ordre); } - public function setPusher(\User_Adapter $user) - { - $this->__load(); - return parent::setPusher($user); - } - - public function getPusher(\Alchemy\Phrasea\Application $app) - { - $this->__load(); - return parent::getPusher($app); - } - - public function setOwner(\User_Adapter $user) - { - $this->__load(); - return parent::setOwner($user); - } - - public function getOwner(\Alchemy\Phrasea\Application $app) - { - $this->__load(); - return parent::getOwner($app); - } - - 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(\Alchemy\Phrasea\Application $app, \record_adapter $record) { $this->__load(); @@ -213,18 +219,6 @@ class Basket extends \Entities\Basket implements \Doctrine\ORM\Proxy\Proxy return parent::getSize($app); } - public function addElement(\Entities\BasketElement $elements) - { - $this->__load(); - return parent::addElement($elements); - } - - public function removeElement(\Entities\BasketElement $elements) - { - $this->__load(); - return parent::removeElement($elements); - } - public function __sleep() { diff --git a/lib/Doctrine/Proxies/__CG__EntitiesBasketElement.php b/lib/Doctrine/Proxies/__CG__EntitiesBasketElement.php index c78e97c53c..8f6a512276 100644 --- a/lib/Doctrine/Proxies/__CG__EntitiesBasketElement.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesBasketElement.php @@ -75,6 +75,18 @@ class BasketElement extends \Entities\BasketElement implements \Doctrine\ORM\Pro return parent::getSbasId(); } + public function getRecord(\Alchemy\Phrasea\Application $app) + { + $this->__load(); + return parent::getRecord($app); + } + + public function setRecord(\record_adapter $record) + { + $this->__load(); + return parent::setRecord($record); + } + public function setOrd($ord) { $this->__load(); @@ -111,7 +123,25 @@ class BasketElement extends \Entities\BasketElement implements \Doctrine\ORM\Pro return parent::getUpdated(); } - public function setBasket(\Entities\Basket $basket) + public function addValidationData(\Entities\ValidationData $validationDatas) + { + $this->__load(); + return parent::addValidationData($validationDatas); + } + + public function removeValidationData(\Entities\ValidationData $validationDatas) + { + $this->__load(); + return parent::removeValidationData($validationDatas); + } + + public function getValidationDatas() + { + $this->__load(); + return parent::getValidationDatas(); + } + + public function setBasket(\Entities\Basket $basket = NULL) { $this->__load(); return parent::setBasket($basket); @@ -123,36 +153,12 @@ class BasketElement extends \Entities\BasketElement implements \Doctrine\ORM\Pro return parent::getBasket(); } - public function getRecord(\Alchemy\Phrasea\Application $app) - { - $this->__load(); - return parent::getRecord($app); - } - - 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, \Alchemy\Phrasea\Application $app) { $this->__load(); @@ -174,7 +180,7 @@ class BasketElement extends \Entities\BasketElement implements \Doctrine\ORM\Pro if ($original === null) { throw new \Doctrine\ORM\EntityNotFoundException(); } - foreach ($class->reflFields AS $field => $reflProperty) { + foreach ($class->reflFields as $field => $reflProperty) { $reflProperty->setValue($this, $reflProperty->getValue($original)); } unset($this->_entityPersister, $this->_identifier); diff --git a/lib/Doctrine/Proxies/__CG__EntitiesLazaretAttribute.php b/lib/Doctrine/Proxies/__CG__EntitiesLazaretAttribute.php index 858e18313f..fea24ab340 100644 --- a/lib/Doctrine/Proxies/__CG__EntitiesLazaretAttribute.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesLazaretAttribute.php @@ -126,7 +126,7 @@ class LazaretAttribute extends \Entities\LazaretAttribute implements \Doctrine\O if ($original === null) { throw new \Doctrine\ORM\EntityNotFoundException(); } - foreach ($class->reflFields AS $field => $reflProperty) { + foreach ($class->reflFields as $field => $reflProperty) { $reflProperty->setValue($this, $reflProperty->getValue($original)); } unset($this->_entityPersister, $this->_identifier); diff --git a/lib/Doctrine/Proxies/__CG__EntitiesLazaretCheck.php b/lib/Doctrine/Proxies/__CG__EntitiesLazaretCheck.php index 190ef6bf90..0f5f7fb556 100644 --- a/lib/Doctrine/Proxies/__CG__EntitiesLazaretCheck.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesLazaretCheck.php @@ -51,18 +51,6 @@ class LazaretCheck extends \Entities\LazaretCheck implements \Doctrine\ORM\Proxy return parent::getId(); } - public function setLazaretFile(\Entities\LazaretFile $lazaretFile = NULL) - { - $this->__load(); - return parent::setLazaretFile($lazaretFile); - } - - public function getLazaretFile() - { - $this->__load(); - return parent::getLazaretFile(); - } - public function setCheckClassname($checkClassname) { $this->__load(); @@ -75,6 +63,18 @@ class LazaretCheck extends \Entities\LazaretCheck implements \Doctrine\ORM\Proxy return parent::getCheckClassname(); } + public function setLazaretFile(\Entities\LazaretFile $lazaretFile = NULL) + { + $this->__load(); + return parent::setLazaretFile($lazaretFile); + } + + public function getLazaretFile() + { + $this->__load(); + return parent::getLazaretFile(); + } + public function getMessage() { $this->__load(); @@ -96,7 +96,7 @@ class LazaretCheck extends \Entities\LazaretCheck implements \Doctrine\ORM\Proxy if ($original === null) { throw new \Doctrine\ORM\EntityNotFoundException(); } - foreach ($class->reflFields AS $field => $reflProperty) { + foreach ($class->reflFields as $field => $reflProperty) { $reflProperty->setValue($this, $reflProperty->getValue($original)); } unset($this->_entityPersister, $this->_identifier); diff --git a/lib/Doctrine/Proxies/__CG__EntitiesLazaretFile.php b/lib/Doctrine/Proxies/__CG__EntitiesLazaretFile.php index a6823d2062..835b711a3b 100644 --- a/lib/Doctrine/Proxies/__CG__EntitiesLazaretFile.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesLazaretFile.php @@ -51,6 +51,42 @@ class LazaretFile extends \Entities\LazaretFile implements \Doctrine\ORM\Proxy\P return parent::getId(); } + public function setFilename($filename) + { + $this->__load(); + return parent::setFilename($filename); + } + + public function getFilename() + { + $this->__load(); + return parent::getFilename(); + } + + public function setThumbFilename($thumbFilename) + { + $this->__load(); + return parent::setThumbFilename($thumbFilename); + } + + public function getThumbFilename() + { + $this->__load(); + return parent::getThumbFilename(); + } + + public function setOriginalName($originalName) + { + $this->__load(); + return parent::setOriginalName($originalName); + } + + public function getOriginalName() + { + $this->__load(); + return parent::getOriginalName(); + } + public function setBaseId($baseId) { $this->__load(); @@ -63,6 +99,12 @@ class LazaretFile extends \Entities\LazaretFile implements \Doctrine\ORM\Proxy\P return parent::getBaseId(); } + public function getCollection(\Alchemy\Phrasea\Application $app) + { + $this->__load(); + return parent::getCollection($app); + } + public function setUuid($uuid) { $this->__load(); @@ -87,6 +129,18 @@ class LazaretFile extends \Entities\LazaretFile implements \Doctrine\ORM\Proxy\P return parent::getSha256(); } + public function setForced($forced) + { + $this->__load(); + return parent::setForced($forced); + } + + public function getForced() + { + $this->__load(); + return parent::getForced(); + } + public function setCreated($created) { $this->__load(); @@ -111,10 +165,16 @@ class LazaretFile extends \Entities\LazaretFile implements \Doctrine\ORM\Proxy\P return parent::getUpdated(); } - public function addLazaretAttribute(\Entities\LazaretAttribute $attributes) + public function addAttribute(\Entities\LazaretAttribute $attributes) { $this->__load(); - return parent::addLazaretAttribute($attributes); + return parent::addAttribute($attributes); + } + + public function removeAttribute(\Entities\LazaretAttribute $attributes) + { + $this->__load(); + return parent::removeAttribute($attributes); } public function getAttributes() @@ -123,6 +183,24 @@ class LazaretFile extends \Entities\LazaretFile implements \Doctrine\ORM\Proxy\P return parent::getAttributes(); } + public function addCheck(\Entities\LazaretCheck $checks) + { + $this->__load(); + return parent::addCheck($checks); + } + + public function removeCheck(\Entities\LazaretCheck $checks) + { + $this->__load(); + return parent::removeCheck($checks); + } + + public function getChecks() + { + $this->__load(); + return parent::getChecks(); + } + public function setSession(\Entities\LazaretSession $session = NULL) { $this->__load(); @@ -135,78 +213,12 @@ class LazaretFile extends \Entities\LazaretFile implements \Doctrine\ORM\Proxy\P return parent::getSession(); } - public function setOriginalName($originalName) - { - $this->__load(); - return parent::setOriginalName($originalName); - } - - public function getOriginalName() - { - $this->__load(); - return parent::getOriginalName(); - } - - public function addLazaretCheck(\Entities\LazaretCheck $checks) - { - $this->__load(); - return parent::addLazaretCheck($checks); - } - - public function getChecks() - { - $this->__load(); - return parent::getChecks(); - } - - public function setForced($forced) - { - $this->__load(); - return parent::setForced($forced); - } - - public function getForced() - { - $this->__load(); - return parent::getForced(); - } - - public function getCollection(\Alchemy\Phrasea\Application $app) - { - $this->__load(); - return parent::getCollection($app); - } - public function getRecordsToSubstitute(\Alchemy\Phrasea\Application $app) { $this->__load(); return parent::getRecordsToSubstitute($app); } - public function setFilename($filename) - { - $this->__load(); - return parent::setFilename($filename); - } - - public function getFilename() - { - $this->__load(); - return parent::getFilename(); - } - - public function setThumbFilename($thumbFilename) - { - $this->__load(); - return parent::setThumbFilename($thumbFilename); - } - - public function getThumbFilename() - { - $this->__load(); - return parent::getThumbFilename(); - } - public function __sleep() { @@ -222,7 +234,7 @@ class LazaretFile extends \Entities\LazaretFile implements \Doctrine\ORM\Proxy\P if ($original === null) { throw new \Doctrine\ORM\EntityNotFoundException(); } - foreach ($class->reflFields AS $field => $reflProperty) { + foreach ($class->reflFields as $field => $reflProperty) { $reflProperty->setValue($this, $reflProperty->getValue($original)); } unset($this->_entityPersister, $this->_identifier); diff --git a/lib/Doctrine/Proxies/__CG__EntitiesLazaretSession.php b/lib/Doctrine/Proxies/__CG__EntitiesLazaretSession.php index 60fc38a8c5..ddbbd0f5d7 100644 --- a/lib/Doctrine/Proxies/__CG__EntitiesLazaretSession.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesLazaretSession.php @@ -57,6 +57,12 @@ class LazaretSession extends \Entities\LazaretSession implements \Doctrine\ORM\P return parent::setUsrId($usrId); } + public function getUsrId() + { + $this->__load(); + return parent::getUsrId(); + } + public function getUser(\Alchemy\Phrasea\Application $app) { $this->__load(); @@ -87,30 +93,6 @@ class LazaretSession extends \Entities\LazaretSession implements \Doctrine\ORM\P return parent::getUpdated(); } - public function addLazaretFiles(\Entities\LazaretFile $files) - { - $this->__load(); - return parent::addLazaretFiles($files); - } - - public function getFiles() - { - $this->__load(); - return parent::getFiles(); - } - - public function addLazaretFile(\Entities\LazaretFile $files) - { - $this->__load(); - return parent::addLazaretFile($files); - } - - public function getUsrId() - { - $this->__load(); - return parent::getUsrId(); - } - public function addFile(\Entities\LazaretFile $files) { $this->__load(); @@ -123,6 +105,12 @@ class LazaretSession extends \Entities\LazaretSession implements \Doctrine\ORM\P return parent::removeFile($files); } + public function getFiles() + { + $this->__load(); + return parent::getFiles(); + } + public function __sleep() { diff --git a/lib/Doctrine/Proxies/__CG__EntitiesSession.php b/lib/Doctrine/Proxies/__CG__EntitiesSession.php index dbc6b52ab8..c53261899b 100644 --- a/lib/Doctrine/Proxies/__CG__EntitiesSession.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesSession.php @@ -207,10 +207,16 @@ class Session extends \Entities\Session implements \Doctrine\ORM\Proxy\Proxy return parent::getUpdated(); } - public function addSessionModule(\Entities\SessionModule $modules) + public function addModule(\Entities\SessionModule $modules) { $this->__load(); - return parent::addSessionModule($modules); + return parent::addModule($modules); + } + + public function removeModule(\Entities\SessionModule $modules) + { + $this->__load(); + return parent::removeModule($modules); } public function getModules() @@ -219,6 +225,12 @@ class Session extends \Entities\Session implements \Doctrine\ORM\Proxy\Proxy return parent::getModules(); } + public function getModuleById($moduleId) + { + $this->__load(); + return parent::getModuleById($moduleId); + } + public function hasModuleId($moduleId) { $this->__load(); @@ -240,7 +252,7 @@ class Session extends \Entities\Session implements \Doctrine\ORM\Proxy\Proxy if ($original === null) { throw new \Doctrine\ORM\EntityNotFoundException(); } - foreach ($class->reflFields AS $field => $reflProperty) { + foreach ($class->reflFields as $field => $reflProperty) { $reflProperty->setValue($this, $reflProperty->getValue($original)); } unset($this->_entityPersister, $this->_identifier); diff --git a/lib/Doctrine/Proxies/__CG__EntitiesSessionModule.php b/lib/Doctrine/Proxies/__CG__EntitiesSessionModule.php index edb73decba..7f4a57820e 100644 --- a/lib/Doctrine/Proxies/__CG__EntitiesSessionModule.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesSessionModule.php @@ -75,18 +75,6 @@ class SessionModule extends \Entities\SessionModule implements \Doctrine\ORM\Pro return parent::getCreated(); } - public function setSession(\Entities\Session $session = NULL) - { - $this->__load(); - return parent::setSession($session); - } - - public function getSession() - { - $this->__load(); - return parent::getSession(); - } - public function setUpdated($updated) { $this->__load(); @@ -99,6 +87,18 @@ class SessionModule extends \Entities\SessionModule implements \Doctrine\ORM\Pro return parent::getUpdated(); } + public function setSession(\Entities\Session $session = NULL) + { + $this->__load(); + return parent::setSession($session); + } + + public function getSession() + { + $this->__load(); + return parent::getSession(); + } + public function __sleep() { @@ -114,7 +114,7 @@ class SessionModule extends \Entities\SessionModule implements \Doctrine\ORM\Pro if ($original === null) { throw new \Doctrine\ORM\EntityNotFoundException(); } - foreach ($class->reflFields AS $field => $reflProperty) { + foreach ($class->reflFields as $field => $reflProperty) { $reflProperty->setValue($this, $reflProperty->getValue($original)); } unset($this->_entityPersister, $this->_identifier); diff --git a/lib/Doctrine/Proxies/__CG__EntitiesStoryWZ.php b/lib/Doctrine/Proxies/__CG__EntitiesStoryWZ.php index 91574d1eb4..4a775c17a1 100644 --- a/lib/Doctrine/Proxies/__CG__EntitiesStoryWZ.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesStoryWZ.php @@ -75,6 +75,18 @@ class StoryWZ extends \Entities\StoryWZ implements \Doctrine\ORM\Proxy\Proxy return parent::getRecordId(); } + public function getRecord(\Alchemy\Phrasea\Application $app) + { + $this->__load(); + return parent::getRecord($app); + } + + public function setRecord(\record_adapter $record) + { + $this->__load(); + return parent::setRecord($record); + } + public function setUsrId($usrId) { $this->__load(); @@ -87,18 +99,6 @@ class StoryWZ extends \Entities\StoryWZ implements \Doctrine\ORM\Proxy\Proxy 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(); @@ -111,16 +111,16 @@ class StoryWZ extends \Entities\StoryWZ implements \Doctrine\ORM\Proxy\Proxy return parent::getUser($app); } - public function getRecord(\Alchemy\Phrasea\Application $app) + public function setCreated($created) { $this->__load(); - return parent::getRecord($app); + return parent::setCreated($created); } - public function setRecord(\record_adapter $record) + public function getCreated() { $this->__load(); - return parent::setRecord($record); + return parent::getCreated(); } @@ -138,7 +138,7 @@ class StoryWZ extends \Entities\StoryWZ implements \Doctrine\ORM\Proxy\Proxy if ($original === null) { throw new \Doctrine\ORM\EntityNotFoundException(); } - foreach ($class->reflFields AS $field => $reflProperty) { + foreach ($class->reflFields as $field => $reflProperty) { $reflProperty->setValue($this, $reflProperty->getValue($original)); } unset($this->_entityPersister, $this->_identifier); diff --git a/lib/Doctrine/Proxies/__CG__EntitiesUsrAuthProvider.php b/lib/Doctrine/Proxies/__CG__EntitiesUsrAuthProvider.php new file mode 100644 index 0000000000..bdc39416ad --- /dev/null +++ b/lib/Doctrine/Proxies/__CG__EntitiesUsrAuthProvider.php @@ -0,0 +1,142 @@ +_entityPersister = $entityPersister; + $this->_identifier = $identifier; + } + /** @private */ + public function __load() + { + if (!$this->__isInitialized__ && $this->_entityPersister) { + $this->__isInitialized__ = true; + + if (method_exists($this, "__wakeup")) { + // call this after __isInitialized__to avoid infinite recursion + // but before loading to emulate what ClassMetadata::newInstance() + // provides. + $this->__wakeup(); + } + + if ($this->_entityPersister->load($this->_identifier, $this) === null) { + throw new \Doctrine\ORM\EntityNotFoundException(); + } + unset($this->_entityPersister, $this->_identifier); + } + } + + /** @private */ + public function __isInitialized() + { + return $this->__isInitialized__; + } + + + public function getId() + { + if ($this->__isInitialized__ === false) { + return (int) $this->_identifier["id"]; + } + $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 getUser(\Alchemy\Phrasea\Application $app) + { + $this->__load(); + return parent::getUser($app); + } + + public function setProvider($provider) + { + $this->__load(); + return parent::setProvider($provider); + } + + public function getProvider() + { + $this->__load(); + return parent::getProvider(); + } + + public function setDistantId($distantId) + { + $this->__load(); + return parent::setDistantId($distantId); + } + + public function getDistantId() + { + $this->__load(); + return parent::getDistantId(); + } + + public function setUpdated($updated) + { + $this->__load(); + return parent::setUpdated($updated); + } + + public function getUpdated() + { + $this->__load(); + return parent::getUpdated(); + } + + public function setCreated($created) + { + $this->__load(); + return parent::setCreated($created); + } + + public function getCreated() + { + $this->__load(); + return parent::getCreated(); + } + + + public function __sleep() + { + return array('__isInitialized__', 'id', 'usr_id', 'provider', 'distant_id', 'updated', 'created'); + } + + public function __clone() + { + if (!$this->__isInitialized__ && $this->_entityPersister) { + $this->__isInitialized__ = true; + $class = $this->_entityPersister->getClassMetadata(); + $original = $this->_entityPersister->load($this->_identifier); + if ($original === null) { + throw new \Doctrine\ORM\EntityNotFoundException(); + } + foreach ($class->reflFields as $field => $reflProperty) { + $reflProperty->setValue($this, $reflProperty->getValue($original)); + } + unset($this->_entityPersister, $this->_identifier); + } + + } +} \ No newline at end of file diff --git a/lib/Doctrine/Proxies/__CG__EntitiesUsrList.php b/lib/Doctrine/Proxies/__CG__EntitiesUsrList.php index eb7140ad47..c641205091 100644 --- a/lib/Doctrine/Proxies/__CG__EntitiesUsrList.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesUsrList.php @@ -87,10 +87,16 @@ class UsrList extends \Entities\UsrList implements \Doctrine\ORM\Proxy\Proxy return parent::getUpdated(); } - public function addUsrListOwner(\Entities\UsrListOwner $owners) + public function addOwner(\Entities\UsrListOwner $owners) { $this->__load(); - return parent::addUsrListOwner($owners); + return parent::addOwner($owners); + } + + public function removeOwner(\Entities\UsrListOwner $owners) + { + $this->__load(); + return parent::removeOwner($owners); } public function getOwners() @@ -99,6 +105,24 @@ class UsrList extends \Entities\UsrList implements \Doctrine\ORM\Proxy\Proxy return parent::getOwners(); } + public function addEntrie(\Entities\UsrListEntry $entries) + { + $this->__load(); + return parent::addEntrie($entries); + } + + public function removeEntrie(\Entities\UsrListEntry $entries) + { + $this->__load(); + return parent::removeEntrie($entries); + } + + public function getEntries() + { + $this->__load(); + return parent::getEntries(); + } + public function hasAccess(\User_Adapter $user, \Alchemy\Phrasea\Application $app) { $this->__load(); @@ -111,48 +135,12 @@ class UsrList extends \Entities\UsrList implements \Doctrine\ORM\Proxy\Proxy return parent::getOwner($user, $app); } - public function addUsrListEntry(\Entities\UsrListEntry $entry) - { - $this->__load(); - return parent::addUsrListEntry($entry); - } - - public function getEntries() - { - $this->__load(); - return parent::getEntries(); - } - public function has(\User_Adapter $user, \Alchemy\Phrasea\Application $app) { $this->__load(); return parent::has($user, $app); } - public function addOwner(\Entities\UsrListOwner $owners) - { - $this->__load(); - return parent::addOwner($owners); - } - - public function removeOwner(\Entities\UsrListOwner $owners) - { - $this->__load(); - return parent::removeOwner($owners); - } - - public function addEntrie(\Entities\UsrListEntry $entries) - { - $this->__load(); - return parent::addEntrie($entries); - } - - public function removeEntrie(\Entities\UsrListEntry $entries) - { - $this->__load(); - return parent::removeEntrie($entries); - } - public function __sleep() { diff --git a/lib/Doctrine/Proxies/__CG__EntitiesUsrListEntry.php b/lib/Doctrine/Proxies/__CG__EntitiesUsrListEntry.php index c56204efed..63ef5b44f8 100644 --- a/lib/Doctrine/Proxies/__CG__EntitiesUsrListEntry.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesUsrListEntry.php @@ -63,6 +63,18 @@ class UsrListEntry extends \Entities\UsrListEntry implements \Doctrine\ORM\Proxy return parent::getUsrId(); } + public function getUser(\Alchemy\Phrasea\Application $app) + { + $this->__load(); + return parent::getUser($app); + } + + public function setUser(\User_Adapter $user) + { + $this->__load(); + return parent::setUser($user); + } + public function setCreated($created) { $this->__load(); @@ -87,7 +99,7 @@ class UsrListEntry extends \Entities\UsrListEntry implements \Doctrine\ORM\Proxy return parent::getUpdated(); } - public function setList(\Entities\UsrList $list) + public function setList(\Entities\UsrList $list = NULL) { $this->__load(); return parent::setList($list); @@ -99,18 +111,6 @@ class UsrListEntry extends \Entities\UsrListEntry implements \Doctrine\ORM\Proxy return parent::getList(); } - public function getUser(\Alchemy\Phrasea\Application $app) - { - $this->__load(); - return parent::getUser($app); - } - - public function setUser(\User_Adapter $user) - { - $this->__load(); - return parent::setUser($user); - } - public function __sleep() { @@ -126,7 +126,7 @@ class UsrListEntry extends \Entities\UsrListEntry implements \Doctrine\ORM\Proxy if ($original === null) { throw new \Doctrine\ORM\EntityNotFoundException(); } - foreach ($class->reflFields AS $field => $reflProperty) { + foreach ($class->reflFields as $field => $reflProperty) { $reflProperty->setValue($this, $reflProperty->getValue($original)); } unset($this->_entityPersister, $this->_identifier); diff --git a/lib/Doctrine/Proxies/__CG__EntitiesUsrListOwner.php b/lib/Doctrine/Proxies/__CG__EntitiesUsrListOwner.php index 735837d3a4..659f2e6cbc 100644 --- a/lib/Doctrine/Proxies/__CG__EntitiesUsrListOwner.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesUsrListOwner.php @@ -63,6 +63,18 @@ class UsrListOwner extends \Entities\UsrListOwner implements \Doctrine\ORM\Proxy return parent::getUsrId(); } + public function setUser(\User_Adapter $user) + { + $this->__load(); + return parent::setUser($user); + } + + public function getUser(\Alchemy\Phrasea\Application $app) + { + $this->__load(); + return parent::getUser($app); + } + public function setRole($role) { $this->__load(); @@ -99,7 +111,7 @@ class UsrListOwner extends \Entities\UsrListOwner implements \Doctrine\ORM\Proxy return parent::getUpdated(); } - public function setList(\Entities\UsrList $list) + public function setList(\Entities\UsrList $list = NULL) { $this->__load(); return parent::setList($list); @@ -111,18 +123,6 @@ class UsrListOwner extends \Entities\UsrListOwner implements \Doctrine\ORM\Proxy return parent::getList(); } - public function setUser(\User_Adapter $user) - { - $this->__load(); - return parent::setUser($user); - } - - public function getUser(\Alchemy\Phrasea\Application $app) - { - $this->__load(); - return parent::getUser($app); - } - public function __sleep() { diff --git a/lib/Doctrine/Proxies/__CG__EntitiesValidationData.php b/lib/Doctrine/Proxies/__CG__EntitiesValidationData.php index cc6f315171..6f6de67e04 100644 --- a/lib/Doctrine/Proxies/__CG__EntitiesValidationData.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesValidationData.php @@ -87,7 +87,7 @@ class ValidationData extends \Entities\ValidationData implements \Doctrine\ORM\P return parent::getUpdated(); } - public function setParticipant(\Entities\ValidationParticipant $participant) + public function setParticipant(\Entities\ValidationParticipant $participant = NULL) { $this->__load(); return parent::setParticipant($participant); @@ -99,7 +99,7 @@ class ValidationData extends \Entities\ValidationData implements \Doctrine\ORM\P return parent::getParticipant(); } - public function setBasketElement(\Entities\BasketElement $basketElement) + public function setBasketElement(\Entities\BasketElement $basketElement = NULL) { $this->__load(); return parent::setBasketElement($basketElement); @@ -126,7 +126,7 @@ class ValidationData extends \Entities\ValidationData implements \Doctrine\ORM\P if ($original === null) { throw new \Doctrine\ORM\EntityNotFoundException(); } - foreach ($class->reflFields AS $field => $reflProperty) { + foreach ($class->reflFields as $field => $reflProperty) { $reflProperty->setValue($this, $reflProperty->getValue($original)); } unset($this->_entityPersister, $this->_identifier); diff --git a/lib/Doctrine/Proxies/__CG__EntitiesValidationParticipant.php b/lib/Doctrine/Proxies/__CG__EntitiesValidationParticipant.php index eda8b15962..cef3296458 100644 --- a/lib/Doctrine/Proxies/__CG__EntitiesValidationParticipant.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesValidationParticipant.php @@ -63,36 +63,6 @@ class ValidationParticipant extends \Entities\ValidationParticipant implements \ 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(); @@ -105,22 +75,16 @@ class ValidationParticipant extends \Entities\ValidationParticipant implements \ return parent::getUser($app); } - public function setReminded($reminded) + public function setIsAware($isAware) { $this->__load(); - return parent::setReminded($reminded); + return parent::setIsAware($isAware); } - public function getReminded() + public function getIsAware() { $this->__load(); - return parent::getReminded(); - } - - public function getDatas() - { - $this->__load(); - return parent::getDatas(); + return parent::getIsAware(); } public function setIsConfirmed($isConfirmed) @@ -159,6 +123,48 @@ class ValidationParticipant extends \Entities\ValidationParticipant implements \ return parent::getCanSeeOthers(); } + public function setReminded($reminded) + { + $this->__load(); + return parent::setReminded($reminded); + } + + public function getReminded() + { + $this->__load(); + return parent::getReminded(); + } + + public function addData(\Entities\ValidationData $datas) + { + $this->__load(); + return parent::addData($datas); + } + + public function removeData(\Entities\ValidationData $datas) + { + $this->__load(); + return parent::removeData($datas); + } + + public function getDatas() + { + $this->__load(); + return parent::getDatas(); + } + + public function setSession(\Entities\ValidationSession $session = NULL) + { + $this->__load(); + return parent::setSession($session); + } + + public function getSession() + { + $this->__load(); + return parent::getSession(); + } + public function isReleasable() { $this->__load(); @@ -180,7 +186,7 @@ class ValidationParticipant extends \Entities\ValidationParticipant implements \ if ($original === null) { throw new \Doctrine\ORM\EntityNotFoundException(); } - foreach ($class->reflFields AS $field => $reflProperty) { + foreach ($class->reflFields as $field => $reflProperty) { $reflProperty->setValue($this, $reflProperty->getValue($original)); } unset($this->_entityPersister, $this->_identifier); diff --git a/lib/Doctrine/Proxies/__CG__EntitiesValidationSession.php b/lib/Doctrine/Proxies/__CG__EntitiesValidationSession.php index 458e8f78ab..c28d4ad3e3 100644 --- a/lib/Doctrine/Proxies/__CG__EntitiesValidationSession.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesValidationSession.php @@ -51,40 +51,34 @@ class ValidationSession extends \Entities\ValidationSession implements \Doctrine return parent::getId(); } - public function setName($name) + public function setInitiatorId($initiatorId) { $this->__load(); - return parent::setName($name); + return parent::setInitiatorId($initiatorId); } - public function getName() + public function getInitiatorId() { $this->__load(); - return parent::getName(); + return parent::getInitiatorId(); } - public function setDescription($description) + public function isInitiator(\User_Adapter $user) { $this->__load(); - return parent::setDescription($description); + return parent::isInitiator($user); } - public function getDescription() + public function setInitiator(\User_Adapter $user) { $this->__load(); - return parent::getDescription(); + return parent::setInitiator($user); } - public function setArchived($archived) + public function getInitiator(\Alchemy\Phrasea\Application $app) { $this->__load(); - return parent::setArchived($archived); - } - - public function getArchived() - { - $this->__load(); - return parent::getArchived(); + return parent::getInitiator($app); } public function setCreated($created) @@ -123,19 +117,7 @@ class ValidationSession extends \Entities\ValidationSession implements \Doctrine 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) + public function setBasket(\Entities\Basket $basket = NULL) { $this->__load(); return parent::setBasket($basket); @@ -147,10 +129,16 @@ class ValidationSession extends \Entities\ValidationSession implements \Doctrine return parent::getBasket(); } - public function addValidationParticipant(\Entities\ValidationParticipant $participants) + public function addParticipant(\Entities\ValidationParticipant $participants) { $this->__load(); - return parent::addValidationParticipant($participants); + return parent::addParticipant($participants); + } + + public function removeParticipant(\Entities\ValidationParticipant $participants) + { + $this->__load(); + return parent::removeParticipant($participants); } public function getParticipants() @@ -159,42 +147,6 @@ class ValidationSession extends \Entities\ValidationSession implements \Doctrine return parent::getParticipants(); } - public function getParticipant(\User_Adapter $user, \Alchemy\Phrasea\Application $app) - { - $this->__load(); - return parent::getParticipant($user, $app); - } - - 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(\Alchemy\Phrasea\Application $app) - { - $this->__load(); - return parent::getInitiator($app); - } - public function isFinished() { $this->__load(); @@ -207,6 +159,12 @@ class ValidationSession extends \Entities\ValidationSession implements \Doctrine return parent::getValidationString($app, $user); } + public function getParticipant(\User_Adapter $user, \Alchemy\Phrasea\Application $app) + { + $this->__load(); + return parent::getParticipant($user, $app); + } + public function __sleep() { @@ -222,7 +180,7 @@ class ValidationSession extends \Entities\ValidationSession implements \Doctrine if ($original === null) { throw new \Doctrine\ORM\EntityNotFoundException(); } - foreach ($class->reflFields AS $field => $reflProperty) { + foreach ($class->reflFields as $field => $reflProperty) { $reflProperty->setValue($this, $reflProperty->getValue($original)); } unset($this->_entityPersister, $this->_identifier); diff --git a/lib/Doctrine/Repositories/BasketRepository.php b/lib/Doctrine/Repositories/BasketRepository.php index be06758862..395314a79e 100644 --- a/lib/Doctrine/Repositories/BasketRepository.php +++ b/lib/Doctrine/Repositories/BasketRepository.php @@ -148,7 +148,7 @@ class BasketRepository extends EntityRepository if ($basket->getOwner($app)->get_id() != $user->get_id()) { $participant = false; - if ($basket->getValidation() && ! $requireOwner) { + if ($basket->getValidation() && !$requireOwner) { try { $basket->getValidation()->getParticipant($user, $app); $participant = true; @@ -156,7 +156,7 @@ class BasketRepository extends EntityRepository } } - if ( ! $participant) { + if (!$participant) { throw new AccessDeniedHttpException(_('You have not access to this basket')); } } diff --git a/lib/Doctrine/Repositories/SessionModuleRepository.php b/lib/Doctrine/Repositories/SessionModuleRepository.php index c5f040a0ce..d5820867c8 100644 --- a/lib/Doctrine/Repositories/SessionModuleRepository.php +++ b/lib/Doctrine/Repositories/SessionModuleRepository.php @@ -12,4 +12,4 @@ use Doctrine\ORM\EntityRepository; */ class SessionModuleRepository extends EntityRepository { -} \ No newline at end of file +} diff --git a/lib/Doctrine/Repositories/SessionRepository.php b/lib/Doctrine/Repositories/SessionRepository.php index 2dfe7ab208..747d99d7f3 100644 --- a/lib/Doctrine/Repositories/SessionRepository.php +++ b/lib/Doctrine/Repositories/SessionRepository.php @@ -12,4 +12,4 @@ use Doctrine\ORM\EntityRepository; */ class SessionRepository extends EntityRepository { -} \ No newline at end of file +} diff --git a/lib/Doctrine/Repositories/UsrListEntryRepository.php b/lib/Doctrine/Repositories/UsrListEntryRepository.php index 9b00ba70b5..da537ce723 100644 --- a/lib/Doctrine/Repositories/UsrListEntryRepository.php +++ b/lib/Doctrine/Repositories/UsrListEntryRepository.php @@ -26,7 +26,6 @@ class UsrListEntryRepository extends EntityRepository $dql = 'SELECT e FROM Entities\UsrListEntry e WHERE e.usr_id = :usr_id'; - $params = array( 'usr_id' => $user->get_id(), ); @@ -41,7 +40,7 @@ class UsrListEntryRepository extends EntityRepository { $entry = $this->find($entry_id); - if ( ! $entry) { + if (!$entry) { throw new NotFoundHttpException('Entry not found'); } @@ -69,7 +68,7 @@ class UsrListEntryRepository extends EntityRepository $entry = $query->getResult(); - if ( ! $entry) { + if (!$entry) { throw new NotFoundHttpException('Entry not found'); } diff --git a/lib/Doctrine/Repositories/UsrListRepository.php b/lib/Doctrine/Repositories/UsrListRepository.php index 70e67a3bbf..193e04b99a 100644 --- a/lib/Doctrine/Repositories/UsrListRepository.php +++ b/lib/Doctrine/Repositories/UsrListRepository.php @@ -28,7 +28,6 @@ class UsrListRepository extends EntityRepository JOIN l.owners o WHERE o.usr_id = :usr_id'; - $params = array( 'usr_id' => $user->get_id(), ); diff --git a/lib/Doctrine/Repositories/ValidationParticipantRepository.php b/lib/Doctrine/Repositories/ValidationParticipantRepository.php index 7aed290abd..93cdfa8809 100644 --- a/lib/Doctrine/Repositories/ValidationParticipantRepository.php +++ b/lib/Doctrine/Repositories/ValidationParticipantRepository.php @@ -44,4 +44,3 @@ class ValidationParticipantRepository extends EntityRepository ->getResult(); } } - diff --git a/lib/classes/User/Adapter.php b/lib/classes/User/Adapter.php index 071bc23f77..ccac1b9908 100644 --- a/lib/classes/User/Adapter.php +++ b/lib/classes/User/Adapter.php @@ -1486,7 +1486,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface $module->setModuleId($app_id); $module->setSession($session); - $session->addSessionModule($module); + $session->addModule($module); $app['EM']->persist($module); $app['EM']->persist($session); diff --git a/lib/classes/patch/3810.php b/lib/classes/patch/3810.php new file mode 100644 index 0000000000..4784386c8f --- /dev/null +++ b/lib/classes/patch/3810.php @@ -0,0 +1,69 @@ +release; + } + + /** + * {@inheritdoc} + */ + public function require_all_upgrades() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function concern() + { + return $this->concern; + } + + /** + * {@inheritdoc} + */ + public function apply(base $appbox, Application $app) + { + $sql = 'SELECT id, usage FROM `order`'; + $stmt = $appbox->get_connection()->prepare($sql); + $stmt->execute(); + $rs = $stmt->fetchAll(\PDO::FETCH_ASSOC); + $stmt->closeCursor(); + + $sql = 'UPDATE `order` SET usage = :usage WHERE id = :id'; + $stmt = $appbox->get_connection()->prepare($sql); + + foreach ($rs as $row) { + $stmt->execute(array( + ':usage' => strip_tags($row['usage']), + ':id' => $row['id'], + )); + } + + $stmt->closeCursor(); + } +} diff --git a/lib/classes/set/order.php b/lib/classes/set/order.php index 9f29106dda..21368c7730 100644 --- a/lib/classes/set/order.php +++ b/lib/classes/set/order.php @@ -415,7 +415,7 @@ class set_order extends set_abstract $BasketElement->setRecord($record); $BasketElement->setBasket($Basket); - $Basket->addBasketElement($BasketElement); + $Basket->addElement($BasketElement); $app['EM']->persist($BasketElement); diff --git a/lib/conf.d/PhraseaFixture/Basket/LoadOneBasketEnv.php b/lib/conf.d/PhraseaFixture/Basket/LoadOneBasketEnv.php index 6a93d9f479..dfdb09895c 100644 --- a/lib/conf.d/PhraseaFixture/Basket/LoadOneBasketEnv.php +++ b/lib/conf.d/PhraseaFixture/Basket/LoadOneBasketEnv.php @@ -45,7 +45,7 @@ class LoadOneBasketEnv extends \PhraseaFixture\AbstractWZ implements FixtureInte $this->participants[] = $user; } - public function addBasketElement(\record_adapter $record) + public function addElement(\record_adapter $record) { $this->basketElements[] = $record; } @@ -55,7 +55,6 @@ class LoadOneBasketEnv extends \PhraseaFixture\AbstractWZ implements FixtureInte $basket = new \Entities\Basket(); $basket->setName('test'); - $basket->setDescription('description'); if (null === $this->user) { @@ -67,13 +66,8 @@ class LoadOneBasketEnv extends \PhraseaFixture\AbstractWZ implements FixtureInte $this->addElementToBasket($manager, $basket); $validationSession = new \Entities\ValidationSession(); - $validationSession->setBasket($basket); - $validationSession->setDescription('Une description au hasard'); - - $validationSession->setName('Un nom de validation'); - $expires = new \DateTime(); $expires->modify('+1 week'); diff --git a/lib/conf.d/PhraseaFixture/UsrLists/UsrList.php b/lib/conf.d/PhraseaFixture/UsrLists/UsrList.php index c8956b3608..c6475bb251 100644 --- a/lib/conf.d/PhraseaFixture/UsrLists/UsrList.php +++ b/lib/conf.d/PhraseaFixture/UsrLists/UsrList.php @@ -34,7 +34,7 @@ class UsrList extends ListAbstract implements FixtureInterface $owner = $this->getReference('one-listowner'); $list->setName('new list'); - $list->addUsrListOwner($owner); + $list->addOwner($owner); /* @var $owner \Entities\UsrListOwner */ $owner->setList($list); diff --git a/lib/conf.d/PhraseaFixture/UsrLists/UsrListEntry.php b/lib/conf.d/PhraseaFixture/UsrLists/UsrListEntry.php index 707c2fe2f1..181e1b7fbc 100644 --- a/lib/conf.d/PhraseaFixture/UsrLists/UsrListEntry.php +++ b/lib/conf.d/PhraseaFixture/UsrLists/UsrListEntry.php @@ -47,7 +47,7 @@ class UsrListEntry extends ListAbstract implements FixtureInterface $entry->setList($list); /* @var $list \Entities\UsrList */ - $list->addUsrListEntry($entry); + $list->addEntrie($entry); $manager->persist($entry); $manager->flush(); diff --git a/lib/conf.d/PhraseaFixture/ValidationSession/LoadOneValidationSession.php b/lib/conf.d/PhraseaFixture/ValidationSession/LoadOneValidationSession.php index 71c6ecc230..35f0ec1cad 100644 --- a/lib/conf.d/PhraseaFixture/ValidationSession/LoadOneValidationSession.php +++ b/lib/conf.d/PhraseaFixture/ValidationSession/LoadOneValidationSession.php @@ -35,9 +35,6 @@ class LoadOneValidationSession extends \PhraseaFixture\AbstractWZ implements Fix $this->getReference('one-basket') // load the one-basket stored reference ); - $validationSession->setDescription('Une description au hasard'); - $validationSession->setName('Un nom de validation'); - $expires = new \DateTime(); $expires->modify('+1 week'); $validationSession->setExpires($expires); diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Client/BasketsTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Client/BasketsTest.php index a6e9092e89..60863392e6 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Client/BasketsTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Client/BasketsTest.php @@ -86,7 +86,7 @@ class BasketsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $basketElement->setRecord($record); $basketElement->setLastInBasket(); - $basket->addBasketElement($basketElement); + $basket->addElement($basketElement); self::$DI['app']['EM']->persist($basket); self::$DI['app']['EM']->flush(); diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Prod/BasketTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Prod/BasketTest.php index 208d10f771..e587518449 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Prod/BasketTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Prod/BasketTest.php @@ -133,7 +133,7 @@ class ControllerBasketTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $basket_element->setRecord($record); $basket_element->setLastInBasket(); - $basket->addBasketElement($basket_element); + $basket->addElement($basket_element); self::$DI['app']['EM']->persist($basket); self::$DI['app']['EM']->flush(); @@ -164,7 +164,7 @@ class ControllerBasketTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $basket_element->setRecord($record); $basket_element->setLastInBasket(); - $basket->addBasketElement($basket_element); + $basket->addElement($basket_element); self::$DI['app']['EM']->persist($basket); self::$DI['app']['EM']->flush(); @@ -423,9 +423,6 @@ class ControllerBasketTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $validationSession = new \Entities\ValidationSession(); - $validationSession->setDescription('Une description au hasard'); - $validationSession->setName('Un nom de validation'); - $expires = new \DateTime(); $expires->modify('+1 week'); @@ -444,7 +441,7 @@ class ControllerBasketTest extends \PhraseanetWebTestCaseAuthenticatedAbstract self::$DI['app']['EM']->persist($validationParticipant); - $validationSession->addValidationParticipant($validationParticipant); + $validationSession->addParticipant($validationParticipant); self::$DI['app']['EM']->flush(); diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Prod/LazaretTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Prod/LazaretTest.php index 6bd692aecd..806e52ef81 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Prod/LazaretTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Prod/LazaretTest.php @@ -199,11 +199,11 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract ->will($this->onConsecutiveCalls('metadataValue', $story->get_serialize_key(), '00001111', 'metafieldValue')); //Add the 5 attribute - $lazaretFile->addLazaretAttribute($lazaretAttribute); - $lazaretFile->addLazaretAttribute($lazaretAttribute); - $lazaretFile->addLazaretAttribute($lazaretAttribute); - $lazaretFile->addLazaretAttribute($lazaretAttribute); - $lazaretFile->addLazaretAttribute($lazaretAttribute); + $lazaretFile->addAttribute($lazaretAttribute); + $lazaretFile->addAttribute($lazaretAttribute); + $lazaretFile->addAttribute($lazaretAttribute); + $lazaretFile->addAttribute($lazaretAttribute); + $lazaretFile->addAttribute($lazaretAttribute); $id = 1; //Expect the retrieval of the lazaret file with the provided id diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Prod/RecordsTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Prod/RecordsTest.php index e071742360..60cd4da6d5 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Prod/RecordsTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Prod/RecordsTest.php @@ -158,7 +158,7 @@ class RecordsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $basketElement->setRecord($record); $basketElement->setLastInBasket(); - $basket->addBasketElement($basketElement); + $basket->addElement($basketElement); self::$DI['app']['EM']->persist($basket); self::$DI['app']['EM']->flush(); diff --git a/tests/Alchemy/Tests/Phrasea/Controller/RecordsRequestTest.php b/tests/Alchemy/Tests/Phrasea/Controller/RecordsRequestTest.php index 43e00bec27..99a9626f70 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/RecordsRequestTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/RecordsRequestTest.php @@ -210,7 +210,7 @@ class RecordsRequestTest extends \PhraseanetPHPUnitAuthenticatedAbstract $basket_element = new \Entities\BasketElement(); $basket_element->setRecord($element); $basket_element->setBasket($basket); - $basket->addBasketElement($basket_element); + $basket->addElement($basket_element); self::$DI['app']['EM']->persist($basket_element); self::$DI['app']['EM']->flush(); } diff --git a/tests/classes/Doctrine/Entities/BasketTest.php b/tests/classes/Doctrine/Entities/BasketTest.php index de2fce549f..f0609c6fc9 100644 --- a/tests/classes/Doctrine/Entities/BasketTest.php +++ b/tests/classes/Doctrine/Entities/BasketTest.php @@ -128,13 +128,8 @@ class EntityBasketTest extends PhraseanetPHPUnitAuthenticatedAbstract $this->assertNull($this->basket->getValidation()); $validationSession = new \Entities\ValidationSession(); - $validationSession->setBasket($this->basket); - $validationSession->setDescription('Une description au hasard'); - - $validationSession->setName('Un nom de validation'); - $expires = new \DateTime(); $expires->modify('+1 week'); diff --git a/tests/classes/PhraseanetPHPUnitAbstract.php b/tests/classes/PhraseanetPHPUnitAbstract.php index c7edf9ad52..eb40987689 100644 --- a/tests/classes/PhraseanetPHPUnitAbstract.php +++ b/tests/classes/PhraseanetPHPUnitAbstract.php @@ -378,7 +378,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase $basketElement->setRecord(self::$DI['record_1']); $basketElement->setBasket($basket); - $basket->addBasketElement($basketElement); + $basket->addElement($basketElement); $em = self::$DI['app']['EM']; @@ -419,7 +419,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase $Participant->setCanAgree(true); $Participant->setCanSeeOthers(true); - $Validation->addValidationParticipant($Participant); + $Validation->addParticipant($Participant); $Participant->setSession($Validation); $em->persist($Participant); @@ -457,8 +457,8 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase $basketFixture->addParticipant(self::$DI['user_alt1']); $basketFixture->addParticipant(self::$DI['user_alt2']); - $basketFixture->addBasketElement(self::$DI['record_1']); - $basketFixture->addBasketElement(self::$DI['record_2']); + $basketFixture->addElement(self::$DI['record_1']); + $basketFixture->addElement(self::$DI['record_2']); $loader = new Loader(); $loader->addFixture($basketFixture); diff --git a/tests/classes/record/adapterTest.php b/tests/classes/record/adapterTest.php index 945763da2f..19662e1f9c 100644 --- a/tests/classes/record/adapterTest.php +++ b/tests/classes/record/adapterTest.php @@ -54,7 +54,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract $em->persist($basketElement); - $basket->addBasketElement($basketElement); + $basket->addElement($basketElement); $em->persist($basket); $em->flush(); @@ -505,7 +505,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract self::$DI['app']['EM']->persist($basket_element); - $basket->addBasketElement($basket_element); + $basket->addElement($basket_element); $basket = self::$DI['app']['EM']->merge($basket); self::$DI['app']['EM']->flush();