public function findByDate(\DateTime $date = null)
    {
        $date = $date ?: new \DateTime();

        return $this->repository->findByDate($date);
    }
public function findByDate(\DateTime $date = null)
    {
        $date = $date ?: new \DateTime();

        return $this->repository->findByDate($date);
    }
public function findByDate ( \ DateTime $ date = null ) { $ date = $ date ? : new \ DateTime ( ) ; return $ this -> repository -> findByDate ( $ date ) ; }
Returns posts for current date or a specified date.

@param \DateTime|null $date

@return array
Returns posts for current date or a specified date .