diff --git a/lib/Doctrine/Repositories/BasketRepository.php b/lib/Doctrine/Repositories/BasketRepository.php new file mode 100644 index 0000000000..dc78cc85f0 --- /dev/null +++ b/lib/Doctrine/Repositories/BasketRepository.php @@ -0,0 +1,64 @@ +_em->createQuery($dql); + $query->setParameters(array(':usr_id' => $user->get_id())); + + return $query->getResult(); + } + + + /** + * Returns all baskets that are in validation session not expired and + * where a specified user is participant (not owner) + * + * @param \User_Adapter $user + * @return \Doctrine\Common\Collections\ArrayCollection + */ + public function findActiveValidationByUser(\User_Adapter $user) + { + $dql = 'SELECT b FROM Entities\Basket b + JOIN b.Entities\ValidationSession s + JOIN s.Entities\ValidationParticipant + WHERE b.usr_id != ?1 AND s.usr_id = ?2 + AND s.expires > CURRENT_TIMESTAMP()'; + + $query = $this->_em->createQuery($dql); + $query->setParameters(array(1 => $user->get_id(), 2 => $user->get_id())); + + return $query->getResult(); + } + +} diff --git a/lib/Doctrine/Repositories/StoryWorkZoneRepository.php b/lib/Doctrine/Repositories/StoryWorkZoneRepository.php new file mode 100644 index 0000000000..08a36f9822 --- /dev/null +++ b/lib/Doctrine/Repositories/StoryWorkZoneRepository.php @@ -0,0 +1,38 @@ +findBy(array('usr_id'=>$user->get_id())); + } + +} + diff --git a/lib/Doctrine/Repositories/ValidationParticipantRepository.php b/lib/Doctrine/Repositories/ValidationParticipantRepository.php new file mode 100644 index 0000000000..cab02ba7d7 --- /dev/null +++ b/lib/Doctrine/Repositories/ValidationParticipantRepository.php @@ -0,0 +1,26 @@ +