diff options
| author | 2012-10-28 01:17:15 +0200 | |
|---|---|---|
| committer | 2012-10-28 01:17:15 +0200 | |
| commit | 08a01f87f156fb0a89c032a806645291e6fd55dd (patch) | |
| tree | 21029e844d6f84901e3d4ddf19dcb3b83365be66 /app/models | |
| parent | b5c39ef5ef10ca80816260030ef6a3e9a6c59acf (diff) | |
Ajout informations dans la sidebar
Diffstat (limited to 'app/models')
| -rwxr-xr-x | app/models/Entry.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/Entry.php b/app/models/Entry.php index 6fcc821f4..654286bd7 100755 --- a/app/models/Entry.php +++ b/app/models/Entry.php @@ -273,6 +273,15 @@ class EntryDAO extends Model_pdo { return $res[0]['count']; } + + public function countFavorites () { + $sql = 'SELECT COUNT(*) AS count FROM entry WHERE is_favorite=1'; + $stm = $this->bd->prepare ($sql); + $stm->execute (); + $res = $stm->fetchAll (PDO::FETCH_ASSOC); + + return $res[0]['count']; + } } class HelperEntry { |
