Skip to content

Commit

Permalink
Merge pull request #2 from p2media/master
Browse files Browse the repository at this point in the history
Properly used extbase functions in TimelineEventRepository
  • Loading branch information
domjos1994 authored Apr 1, 2019
2 parents 9322896 + 30a11d9 commit 5c37ea7
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Classes/Domain/Repository/TimelineEventRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,31 @@

namespace DominicJoas\Timeline\Domain\Repository;

use TYPO3\CMS\Extbase\Persistence\Generic\Query;
use TYPO3\CMS\Extbase\Persistence\Repository;

class TimelineEventRepository extends Repository {

/**
* @param int $uid
* @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface
*/
public function getContentElementEntries($uid) {
/** @var \TYPO3\CMS\Extbase\Persistence\Generic\Query */
$query = $this->createQuery();
$query->statement("SELECT * FROM tx_timeline_domain_model_timelineevent WHERE timetable_id=$uid ORDER BY start_date");

$query->getQuerySettings()->setRespectStoragePage(false);

$query->matching(
$query->equals('timetable_id', (int)$uid)
);
$query->setOrderings([
'start_date' => Query::ORDER_ASCENDING,
]);

/** @var \TYPO3\CMS\Extbase\Persistence\QueryResultInterface */
$result = $query->execute();

return $result;
}
}

0 comments on commit 5c37ea7

Please sign in to comment.