1
0
mirror of synced 2024-12-15 15:46:02 +03:00
doctrine2/website/lib/model/doctrine/BlogPostTable.class.php
2007-09-06 17:20:49 +00:00

29 lines
597 B
PHP

<?php
/*
* Edit this file to customise your model table
*
* auto-generated by the sfDoctrine plugin
*/
class BlogPostTable extends Doctrine_Table
{
public function retrieveLatest($num)
{
$query = new Doctrine_Query();
$query->from('BlogPost p');
$query->limit($num);
$query->orderby('p.created_at DESC');
return $query->execute();
}
public function retrieveBySlug($slug)
{
$query = new Doctrine_Query();
$query->from('BlogPost p');
$query->where('p.slug = ?', $slug);
$query->limit(1);
return $query->execute()->getFirst();
}
}