mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Add getUserValidationDatas method
This commit is contained in:
@@ -22,6 +22,7 @@ require_once __DIR__ . '/../../classes/record/adapter.class.php';
|
|||||||
*/
|
*/
|
||||||
class BasketElement
|
class BasketElement
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $id
|
* @var integer $id
|
||||||
*/
|
*/
|
||||||
@@ -57,7 +58,6 @@ class BasketElement
|
|||||||
*/
|
*/
|
||||||
private $basket;
|
private $basket;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get id
|
* Get id
|
||||||
*
|
*
|
||||||
@@ -203,6 +203,7 @@ class BasketElement
|
|||||||
{
|
{
|
||||||
$this->setOrd($this->getBasket()->getElements()->count() + 1);
|
$this->setOrd($this->getBasket()->getElements()->count() + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Entities\ValidationData
|
* @var Entities\ValidationData
|
||||||
*/
|
*/
|
||||||
@@ -232,4 +233,24 @@ class BasketElement
|
|||||||
{
|
{
|
||||||
return $this->validation_datas;
|
return $this->validation_datas;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param \User_Adapter $user
|
||||||
|
* @return \Entities\ValidationData
|
||||||
|
*/
|
||||||
|
public function getUserValidationDatas(\User_Adapter $user)
|
||||||
|
{
|
||||||
|
foreach ($this->validation_datas as $validationData)
|
||||||
|
{
|
||||||
|
/* @var $validationData \Entities\ValidationData */
|
||||||
|
if ($validationData->getParticipant()->getUser()->get_id() == $user->get_id())
|
||||||
|
{
|
||||||
|
return $validationData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \Exception('There is no such participant');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user