Skip to content

Instantly share code, notes, and snippets.

@TPei
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TPei/3900a7fc3681c8b301d3 to your computer and use it in GitHub Desktop.
Save TPei/3900a7fc3681c8b301d3 to your computer and use it in GitHub Desktop.
Proposed improvement to typo3 flow documentation
/**
* Finds posts by the specified blog
*
* @param \TYPO3\Blog\Domain\Model\Blog $blog The blog the post must refer to
* @param integer $limit The number of posts to return at max
* @return \TYPO3\Flow\Persistence\QueryResultInterface The posts
*/
public function findByBlog(\TYPO3\Blog\Domain\Model\Blog $blog, $limit) {
$query = $this->createQuery();
$query->setLimit($limit);
return $query->matching($query->equals('blog', $blog))
->setOrderings(array('date' => \TYPO3\Flow\Persistence\QueryInterface::ORDER_DESCENDING))
->execute();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment