Skip to content

Instantly share code, notes, and snippets.

@K-Phoen
Created May 25, 2012 07:44
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 K-Phoen/2786447 to your computer and use it in GitHub Desktop.
Save K-Phoen/2786447 to your computer and use it in GitHub Desktop.
<?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);
}
}
@divarvel
Copy link

T'étais pas censé faire du scala toi ?

@K-Phoen
Copy link
Author

K-Phoen commented May 25, 2012

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 :-°

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment