public function getLastUpdatedAt()
    {
        $qb = $this->createQueryBuilder('p');

        $date = $qb
            ->select('p.updatedAt')
            ->addOrderBy('p.updatedAt', 'DESC')
            ->getQuery()
            ->setMaxResults(1)
            ->getSingleScalarResult();

        if (null !== $date) {
            return new \DateTime($date);
        }

        return null;
    }
public function getLastUpdatedAt()
    {
        $qb = $this->createQueryBuilder('p');

        $date = $qb
            ->select('p.updatedAt')
            ->addOrderBy('p.updatedAt', 'DESC')
            ->getQuery()
            ->setMaxResults(1)
            ->getSingleScalarResult();

        if (null !== $date) {
            return new \DateTime($date);
        }

        return null;
    }
public function getLastUpdatedAt ( ) { $ qb = $ this -> createQueryBuilder ( 'p' ) ; $ date = $ qb -> select ( 'p.updatedAt' ) -> addOrderBy ( 'p.updatedAt' , 'DESC' ) -> getQuery ( ) -> setMaxResults ( 1 ) -> getSingleScalarResult ( ) ; if ( null !== $ date ) { return new \ DateTime ( $ date ) ; } return null ; }
Returns the last updated at date time.

@return \DateTime|null
Returns the last updated at date time .