From bc723b22f4897700381a4759a7ef9ad8ce8a988d Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 25 Oct 2022 14:20:29 +0200 Subject: [PATCH] Added getAll() to News Model --- application/models/content/News_model.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/application/models/content/News_model.php b/application/models/content/News_model.php index 7d475081d..472eb2e56 100644 --- a/application/models/content/News_model.php +++ b/application/models/content/News_model.php @@ -12,12 +12,13 @@ class News_model extends DB_Model $this->pk = 'news_id'; } + /** + * Get all News ordered by date. (most actual on top) + * @param null $limit Amount of news. + * @return array + */ public function getAll($limit = null) { - // TODO check ob über content table. Aktuell sind die news texte NULL, deshalb über content table holen. -// $this->addJoin('campus.tbl_content', 'content_id'); -// $this->addJoin('campus.tbl_contentsprache', 'content_id'); - return $this->loadWhere(' text IS NOT NULL AND datum <= NOW() AND (datum_bis IS NULL OR datum_bis >= now()::date)