mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
refactor send_reminded function
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
namespace Repositories;
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -21,5 +22,26 @@ use Doctrine\ORM\EntityRepository;
|
||||
class ValidationParticipantRepository extends EntityRepository
|
||||
{
|
||||
|
||||
/**
|
||||
* Retrieve all not reminded participants where the validation has not expired
|
||||
*
|
||||
* @param $expireDate The expiration Date
|
||||
* @return array
|
||||
*/
|
||||
public function findNotConfirmedAndNotRemindedParticipantsByExpireDate(\DateTime $expireDate)
|
||||
{
|
||||
$dql = '
|
||||
SELECT p, s
|
||||
FROM Entities\ValidationParticipant p
|
||||
JOIN p.session s
|
||||
JOIN s.basket b
|
||||
WHERE p.is_confirmed = 0
|
||||
AND p.reminded IS NULL
|
||||
AND s.expires < :date';
|
||||
|
||||
return $this->_em->createQuery($dql)
|
||||
->setParameter('date', $expireDate, Type::DATETIME)
|
||||
->getResult();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user