Update BETWEEN

        return $this->createQueryBuilder('c')
            ->update()
            ->set('c.modifiedDatetime', ':modifiedDatetime')->setParameter('modifiedDatetime', $dateTimeNow)
            ->andWhere('c.requestedDatetime BETWEEN :requestedDatetimeStart AND :requestedDatetimeEnd')->setParameter('requestedDatetimeStart', $dateFrom)->setParameter('requestedDatetimeEnd', $dateTo)
            ->andWhere('( (c.modifiedDatetime NOT BETWEEN :dateStart AND :dateEnd) or c.modifiedDatetime is null )')->setParameter('dateStart', $dateFrom)->setParameter('dateEnd', $dateTo)
            ->getQuery()
            ->getSingleScalarResult();
Komentarze wyłączone