for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Task\TaskBundle\Entity;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\NoResultException;
use Task\Execution\TaskExecutionInterface;
use Task\TaskInterface;
use Task\TaskStatus;
class TaskExecutionRepository extends EntityRepository
{
public function findByStartTime(TaskInterface $task, \DateTime $scheduleTime)
try {
return $this->createQueryBuilder('e')
->innerJoin('e.task', 't')
->where('t.uuid = :uuid')
->andWhere('e.scheduleTime = :scheduleTime')
->setParameter('uuid', $task->getUuid())
->setParameter('scheduleTime', $scheduleTime)
->getQuery()
->getSingleResult();
} catch (NoResultException $e) {
return;
}
public function findScheduled(\DateTime $dateTime = null)
if ($dateTime === null) {
$dateTime = new \DateTime();
->where('e.status = :status AND e.scheduleTime < :dateTime')
->setParameter('status', TaskStatus::PLANNED)
->setParameter('dateTime', $dateTime)
->getResult();
public function save(TaskExecutionInterface $execution)
$execution
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$this->_em->flush();
public function add(TaskExecutionInterface $execution)
$this->_em->persist($execution);
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.