Created
May 25, 2012 07:44
-
-
Save K-Phoen/2786447 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
class BookQuery extends BaseBookQuery | |
{ | |
public function recent($nb_max = 5) | |
{ | |
return $this | |
->orderByPublishedAt('desc') | |
->limit($nb_max); | |
} | |
public function published() | |
{ | |
return $this->filterByPublishedAt(null, Criteria::ISNOTNULL); | |
} | |
public static function findRecentByAuthor(Author $author, PropelPDO $con = null) | |
{ | |
return BookQuery::create() | |
->published() | |
->recent() | |
->filterByAuthor($author) | |
->find($con); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mon patron me laisse faire ce que je veux le vendredi aprèm, le matin je dois quand même essayer de bosser un peu :-°