Last active
August 29, 2015 14:05
-
-
Save TPei/3900a7fc3681c8b301d3 to your computer and use it in GitHub Desktop.
Proposed improvement to typo3 flow documentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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