31 return (
bool)count($this->news);
36 return reset($this->news);
41 return (
bool)
current($this->news);
51 return key($this->news);
56 return next($this->news);
61 if(!isset(self::$instance))
73 $this->news = array();
78 $query =
'SELECT * FROM payment_news WHERE 1 = 1 ';
81 $query .=
"AND visibility = %s ";
90 $query .=
"AND creation_date >= %s ";
91 $types[] =
'timestamp';
95 case self::TYPE_ARCHIVE:
96 $query .=
"AND creation_date < %s ";
97 $types[] =
'timestamp';
102 $query .=
'ORDER BY update_date DESC ';
106 while($record = $ilDB->fetchAssoc($result))
109 $oNewsItem->setId($record[
'news_id']);
110 $oNewsItem->setCreationDate($record[
'creation_date']);
111 $oNewsItem->setUpdateDate($record[
'update_date']);
112 $oNewsItem->setTitle($record[
'news_title']);
113 $oNewsItem->setContent($record[
'news_content']);
114 $oNewsItem->setVisibility($record[
'visibility']);
115 $oNewsItem->setUserId($record[
'user_id']);
117 $this->news[] = $oNewsItem;
132 $this->archive_date = $a_archive_date;
142 $this->public_section = $a_public_section;
152 $this->mode = $a_mode;