Files
Phraseanet/lib/Alchemy/Phrasea/Model/Entities/ValidationParticipant.php
Nicolas Le Goff 26bd977d5f Delete references to usr.usr_id field in entities
Conflicts:
	lib/Alchemy/Phrasea/Controller/Prod/Push.php
	lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php
	lib/conf.d/migrations.yml

Conflicts:
	lib/Alchemy/Phrasea/ACL/BasketACL.php
	lib/Alchemy/Phrasea/Authentication/Authenticator.php
	lib/Alchemy/Phrasea/Controller/Prod/Order.php
	lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php
	lib/Alchemy/Phrasea/Controller/Root/RSSFeeds.php
	lib/Alchemy/Phrasea/Controller/Root/Session.php
	lib/Alchemy/Phrasea/Model/Entities/Basket.php
	lib/Alchemy/Phrasea/Model/Entities/BasketElement.php
	lib/Alchemy/Phrasea/Model/Entities/Feed.php
	lib/Alchemy/Phrasea/Model/Entities/FeedEntry.php
	lib/Alchemy/Phrasea/Model/Entities/FtpExport.php
	lib/Alchemy/Phrasea/Model/Entities/Session.php
	lib/Alchemy/Phrasea/Model/Entities/StoryWZ.php
	lib/Alchemy/Phrasea/Model/Entities/UsrList.php
	lib/Alchemy/Phrasea/Model/Entities/UsrListEntry.php
	lib/Alchemy/Phrasea/Model/Entities/UsrListOwner.php
	lib/Alchemy/Phrasea/Model/Entities/ValidationParticipant.php
	lib/Alchemy/Phrasea/Model/Entities/ValidationSession.php
	lib/Alchemy/Phrasea/Model/Repositories/StoryWZRepository.php
	lib/classes/API/V1/adapter.php
	templates/mobile/lightbox/sc_note.html.twig
	templates/web/admin/connected-users.html.twig
	templates/web/admin/publications/fiche.html.twig
	templates/web/lightbox/IE6/agreement_box.html.twig
	templates/web/lightbox/agreement_box.html.twig
	templates/web/lightbox/basket_content_report.html.twig
	templates/web/lightbox/sc_note.html.twig
	templates/web/prod/WorkZone/Browser/Basket.html.twig
	templates/web/prod/WorkZone/Browser/Results.html.twig
	templates/web/prod/WorkZone/Macros.html.twig
	templates/web/prod/actions/Feedback/List-Share.html.twig
	templates/web/prod/actions/Feedback/ListsMacros.html.twig
	templates/web/prod/orders/order_box.html.twig
	templates/web/prod/orders/order_item.html.twig
	templates/web/prod/upload/lazaret.html.twig
	tests/Alchemy/Tests/Phrasea/Controller/Root/SessionTest.php
2014-02-19 17:29:25 +01:00

300 lines
5.4 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="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;
}
/**
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*
* @return User
**/
private $user;
/**
* @param User $user
*
* @return AggregateToken
*/
public function setUser(User $user)
{
$this->user = $user;
return $this;
}
/**
* @return User
*/
public function getUser()
{
return $this->user;
}
/**
* 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;
}
}