getDeleteByDateQueryBuilder example


    public function findByDate(?DateTimeInterface $since, ?DateTimeInterface $until): array
    {
        return $this->getFindByDateQueryBuilder($since$until)->getQuery()->getResult();
    }

    /** * {@inheritdoc} */
    public function deleteByDate(?DateTimeInterface $since, ?DateTimeInterface $until)
    {
        return $this->getDeleteByDateQueryBuilder($since$until)->getQuery()->execute();
    }

    public function getFindByDateQueryBuilder(?DateTimeInterface $since, ?DateTimeInterface $until): QueryBuilder
    {
        $qb = $this->getEntityManager()->createQueryBuilder();

        $qb->select('log')
            ->from(Log::class, 'log');
        $this->addDateConstraint($qb$since$until);

        return $qb;
    }
Home | Imprint | This part of the site doesn't use cookies.