示例#1
0
 function findArticles($select = null)
 {
     $t = new Articles();
     if (is_string($select)) {
         $select = $t->select()->where($select);
     }
     $select->setIntegrityCheck(false)->from('article')->where('article.journal = ?', $this->id);
     return $t->fetchAll($select);
 }
示例#2
0
<?php

$t = new Articles();
$s = $this->model->select;
$s->limit(30);
$articles = $t->fetchAll($s);
foreach ($articles as $article) {
    $link = $this->url(array('controller' => 'journaux', 'action' => 'consulter', 'article' => $article->slug, 'format' => 'html'), null, true);
    $this->feed['entries'][] = array('title' => $article->titre ? $article->titre : $article->slug, 'link' => $link, 'description' => $this->tw->transform($article->getBoulet(), 'Plain'), 'content' => $this->tw->transform($article->article), 'lastUpdate' => strtotime($article->getDate()));
}
示例#3
0
 function findArticles()
 {
     $t = new Articles();
     $s = $t->select()->setIntegrityCheck(false)->distinct()->from('article')->join('commentaire', 'commentaire.id = article.commentaires', array())->where('commentaire.auteur = ?', intval($this->id));
     return $t->fetchAll($s);
 }