Files
Phraseanet/lib/Alchemy/Phrasea/Model/Entities/ValidationParticipant.php
Romain Neutron e233e5afa6 Merge branch '3.8'
Conflicts:
	lib/Alchemy/Phrasea/Command/Developer/JavascriptBuilder.php
	lib/Alchemy/Phrasea/Controller/Prod/Basket.php
	lib/Alchemy/Phrasea/Core/Provider/TaskManagerServiceProvider.php
	lib/classes/Exception/Feed/ItemNotFound.php
	lib/classes/Exception/Feed/PublisherNotFound.php
	lib/classes/Feed/Abstract.php
	lib/classes/Feed/Adapter.php
	lib/classes/Feed/Aggregate.php
	lib/classes/Feed/Collection.php
	lib/classes/Feed/CollectionInterface.php
	lib/classes/Feed/Entry/Adapter.php
	lib/classes/Feed/Entry/Collection.php
	lib/classes/Feed/Entry/Interface.php
	lib/classes/Feed/Entry/Item.php
	lib/classes/Feed/Entry/ItemInterface.php
	lib/classes/Feed/Interface.php
	lib/classes/Feed/Link.php
	lib/classes/Feed/LinkInterface.php
	lib/classes/Feed/Publisher/Adapter.php
	lib/classes/Feed/Publisher/Interface.php
	lib/classes/Feed/Token.php
	lib/classes/Feed/TokenAggregate.php
	lib/classes/Feed/XML/Abstract.php
	lib/classes/Feed/XML/Atom.php
	lib/classes/Feed/XML/Cooliris.php
	lib/classes/Feed/XML/Interface.php
	lib/classes/Feed/XML/RSS.php
	lib/classes/Feed/XML/RSS/ImageInterface.php
	lib/classes/http/request.php
	lib/classes/module/console/schedulerStart.php
	lib/classes/module/console/schedulerState.php
	lib/classes/module/console/schedulerStop.php
	lib/classes/module/console/taskState.php
	lib/classes/module/console/tasklist.php
	lib/classes/module/console/taskrun.php
	lib/classes/registry.php
	lib/classes/registryInterface.php
	lib/classes/set/order.php
	lib/classes/system/url.php
	lib/classes/task/Scheduler.php
	lib/classes/task/appboxAbstract.php
	lib/classes/task/databoxAbstract.php
	lib/classes/task/manager.php
	lib/classes/task/period/RecordMover.php
	lib/classes/task/period/apibridge.php
	lib/classes/task/period/archive.php
	lib/classes/task/period/cindexer.php
	lib/classes/task/period/emptyColl.php
	lib/classes/task/period/ftp.php
	lib/classes/task/period/ftpPull.php
	lib/classes/task/period/subdef.php
	lib/classes/task/period/test.php
	lib/classes/task/period/writemeta.php
	lib/conf.d/PhraseaFixture/AbstractWZ.php
	lib/conf.d/PhraseaFixture/Basket/LoadFiveBaskets.php
	lib/conf.d/PhraseaFixture/Basket/LoadOneBasket.php
	lib/conf.d/PhraseaFixture/Basket/LoadOneBasketEnv.php
	lib/conf.d/PhraseaFixture/Lazaret/LoadOneFile.php
	lib/conf.d/PhraseaFixture/Story/LoadOneStory.php
	lib/conf.d/PhraseaFixture/UsrLists/ListAbstract.php
	lib/conf.d/PhraseaFixture/UsrLists/UsrList.php
	lib/conf.d/PhraseaFixture/UsrLists/UsrListEntry.php
	lib/conf.d/PhraseaFixture/UsrLists/UsrListOwner.php
	lib/conf.d/PhraseaFixture/ValidationParticipant/LoadOneParticipant.php
	lib/conf.d/PhraseaFixture/ValidationParticipant/LoadParticipantWithSession.php
	lib/conf.d/PhraseaFixture/ValidationSession/LoadOneValidationSession.php
2014-01-06 15:38:14 +01:00

317 lines
5.7 KiB
PHP

<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2014 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Model\Entities;
use Alchemy\Phrasea\Application;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="ValidationParticipants")
* @ORM\Entity(repositoryClass="Alchemy\Phrasea\Model\Repositories\ValidationParticipantRepository")
*/
class ValidationParticipant
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
/**
* @ORM\Column(type="integer")
*/
private $usr_id;
/**
* @ORM\Column(type="boolean")
*/
private $is_aware = false;
/**
* @ORM\Column(type="boolean")
*/
private $is_confirmed = false;
/**
* @ORM\Column(type="boolean")
*/
private $can_agree = false;
/**
* @ORM\Column(type="boolean")
*/
private $can_see_others = false;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $reminded;
/**
* @ORM\OneToMany(targetEntity="ValidationData", mappedBy="participant", cascade={"all"})
*/
private $datas;
/**
* @ORM\ManyToOne(targetEntity="ValidationSession", inversedBy="participants", cascade={"persist"})
* @ORM\JoinColumn(name="ValidationSession_id", referencedColumnName="id")
*/
private $session;
/**
* Constructor
*/
public function __construct()
{
$this->datas = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set usr_id
*
* @param integer $usrId
* @return ValidationParticipant
*/
public function setUsrId($usrId)
{
$this->usr_id = $usrId;
return $this;
}
/**
* Get usr_id
*
* @return integer
*/
public function getUsrId()
{
return $this->usr_id;
}
/**
*
* @param \User_Adapter $user
* @return ValidationParticipant
*/
public function setUser(\User_Adapter $user)
{
$this->usr_id = $user->get_id();
return $this;
}
public function getUser(Application $app)
{
return \User_Adapter::getInstance($this->getUsrId(), $app);
}
/**
* Set is_aware
*
* @param boolean $isAware
* @return ValidationParticipant
*/
public function setIsAware($isAware)
{
$this->is_aware = $isAware;
return $this;
}
/**
* Get is_aware
*
* @return boolean
*/
public function getIsAware()
{
return $this->is_aware;
}
/**
* Set is_confirmed
*
* @param boolean $isConfirmed
* @return ValidationParticipant
*/
public function setIsConfirmed($isConfirmed)
{
$this->is_confirmed = $isConfirmed;
return $this;
}
/**
* Get is_confirmed
*
* @return boolean
*/
public function getIsConfirmed()
{
return $this->is_confirmed;
}
/**
* Set can_agree
*
* @param boolean $canAgree
* @return ValidationParticipant
*/
public function setCanAgree($canAgree)
{
$this->can_agree = $canAgree;
return $this;
}
/**
* Get can_agree
*
* @return boolean
*/
public function getCanAgree()
{
return $this->can_agree;
}
/**
* Set can_see_others
*
* @param boolean $canSeeOthers
* @return ValidationParticipant
*/
public function setCanSeeOthers($canSeeOthers)
{
$this->can_see_others = $canSeeOthers;
return $this;
}
/**
* Get can_see_others
*
* @return boolean
*/
public function getCanSeeOthers()
{
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 ValidationData $datas
* @return ValidationParticipant
*/
public function addData(ValidationData $datas)
{
$this->datas[] = $datas;
return $this;
}
/**
* Remove datas
*
* @param ValidationData $datas
*/
public function removeData(ValidationData $datas)
{
$this->datas->removeElement($datas);
}
/**
* Get datas
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getDatas()
{
return $this->datas;
}
/**
* Set session
*
* @param ValidationSession $session
* @return ValidationParticipant
*/
public function setSession(ValidationSession $session = null)
{
$this->session = $session;
return $this;
}
/**
* Get session
*
* @return ValidationSession
*/
public function getSession()
{
return $this->session;
}
public function isReleasable()
{
if ($this->getIsConfirmed()) {
return false;
}
foreach ($this->getDatas() as $validation_data) {
/* @var $validation_data ValidationData */
if ($validation_data->getAgreement() === null) {
return false;
}
}
return true;
}
}