4 include_once
'Services/Payment/classes/class.ilShopTopic.php';
5 include_once
'Services/Payment/classes/class.ilGeneralSettings.php';
43 if(!isset(self::$instance))
57 $this->topics = array();
59 if(!in_array($this->
getSortingType(), array(self::TOPICS_SORT_BY_TITLE, self::TOPICS_SORT_BY_CREATEDATE, self::TOPICS_SORT_MANUALLY)))
71 $data_types = array();
72 $data_values = array();
74 $query =
'SELECT * FROM payment_topics WHERE 1 = 1 ';
77 $query .=
' AND pt_topic_pk = %s';
78 array_push($data_types,
'integer');
85 $query .=
' ORDER BY pt_topic_sort ';
89 $query .=
' ORDER BY pt_topic_created ';
94 $query .=
' ORDER BY pt_topic_title ';
98 $query .=
" , pt_topic_title ";
106 $data_types = array();
107 $data_values = array();
109 $query =
'SELECT * FROM payment_topics ';
113 $query .=
' LEFT JOIN payment_topic_usr_sort ON
114 ptus_pt_topic_fk = pt_topic_pk AND
116 array_push($data_types,
'integer');
117 array_push($data_values, $ilUser->getId());
121 $query .=
' WHERE 1 = 1 ';
123 if((
int)$this->id_filter > 0)
125 $query .=
' AND pt_topic_pk = %s';
126 array_push($data_types,
'integer');
133 $query .=
' ORDER BY ptus_sorting ';
137 $query .=
' ORDER BY pt_topic_created ';
142 $query .=
' ORDER BY pt_topic_title ';
146 $query .=
" , pt_topic_sort ";
150 if(count($data_types) > 0 && count($data_values > 0))
152 $res = $this->db->queryf(
$query, $data_types, $data_values);
160 while(
$row = $this->db->fetchObject(
$res))
163 $oTopic->setId(
$row->pt_topic_pk);
164 $oTopic->setTitle(
$row->pt_topic_title);
165 $oTopic->setSorting(
$row->pt_topic_sort);
166 $oTopic->setCustomSorting((
int)
$row->ptus_sorting);
167 $oTopic->setCreateDate(
$row->pt_topic_created);
168 $oTopic->setChangeDate(
$row->pt_topic_changed);
169 $this->topics[
$row->pt_topic_pk] = $oTopic;
179 return is_array($this->topics) ? $this->topics : array();
184 $this->id_filter = $a_id_filter;
192 $this->sorting_type = $a_sorting_type;
200 $this->sorting_direction = $a_sorting_direction;
208 $this->enable_custom_sorting = (bool)$a_enable_custom_sorting;