aboutsummaryrefslogtreecommitdiff
path: root/app/models/Entry.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-03-17 21:47:25 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-03-17 21:47:25 +0100
commit1c57c2b7bdf360728abd61b19ead39e390cfb250 (patch)
treeb70415fd04998ed9418ce52c0484b50b0522c9e1 /app/models/Entry.php
parentcaf8d18c1d887f0c918ba181d1c48d9e08af6ea0 (diff)
Changement API : export (Uniflux) du flux public à la place du flux des favoris avec content = notes et gestion des tags
Diffstat (limited to 'app/models/Entry.php')
-rwxr-xr-xapp/models/Entry.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/models/Entry.php b/app/models/Entry.php
index d97cad408..3e90db289 100755
--- a/app/models/Entry.php
+++ b/app/models/Entry.php
@@ -442,6 +442,23 @@ class EntryDAO extends Model_pdo {
return HelperEntry::daoToEntry ($stm->fetchAll (PDO::FETCH_ASSOC));
}
+ public function listPublic ($order = 'high_to_low') {
+ $where = ' WHERE is_public=1';
+
+ if ($order == 'low_to_high') {
+ $order = ' DESC';
+ } else {
+ $order = '';
+ }
+
+ $sql = 'SELECT * FROM entry' . $where . ' ORDER BY date' . $order;
+
+ $stm = $this->bd->prepare ($sql);
+ $stm->execute ();
+
+ return HelperEntry::daoToEntry ($stm->fetchAll (PDO::FETCH_ASSOC));
+ }
+
public function listByCategory ($cat, $mode, $search = false, $order = 'high_to_low') {
$where = ' WHERE category=?';
if ($mode == 'not_read') {