1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/** * The repository for Dates */ class DateRepository extends \TYPO3\CMS\Extbase\Persistence\Repository { protected $defaultOrderings = array( 'date_time' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING ); public function findUpcoming( $count ){ $now = new \DateTime(); $query = $this->createQuery(); $query ->setLimit( $count ) ->matching( $query->greaterThanOrEqual('date_time', $now) ); return $query->execute(); } }
You can clone a snippet to your computer for local editing. Learn more.