@@ 73-86 (lines=14) @@ | ||
70 | * @param integer $id |
|
71 | * @return array|bool |
|
72 | */ |
|
73 | public function get_page($id) { |
|
74 | ||
75 | $this->db |
|
76 | ->select('content.*, route.url') |
|
77 | ->where('content.id', $id) |
|
78 | ->join('route', 'route.id = content.route_id'); |
|
79 | $query = $this->db->get('content', 1); |
|
80 | ||
81 | if ($query->num_rows > 0) { |
|
82 | return $query->row_array(); |
|
83 | } |
|
84 | ||
85 | return FALSE; |
|
86 | } |
|
87 | ||
88 | /** |
|
89 | * @param integer $id |
|
@@ 173-185 (lines=13) @@ | ||
170 | * @param int $id |
|
171 | * @return bool|array |
|
172 | */ |
|
173 | public function get_category($id) { |
|
174 | ||
175 | $query = $this->db |
|
176 | ->select('category.*, route.url') |
|
177 | ->where('category.id', $id) |
|
178 | ->join('route', 'route.id = category.route_id')->get('category', 1); |
|
179 | ||
180 | if ($query->num_rows() > 0) { |
|
181 | return $query->row_array(); |
|
182 | } |
|
183 | ||
184 | return FALSE; |
|
185 | } |
|
186 | ||
187 | /** |
|
188 | * Check if category is created |
@@ 205-221 (lines=17) @@ | ||
202 | * @param int $id |
|
203 | * @return bool |
|
204 | */ |
|
205 | public function get_category_by_id($id) { |
|
206 | ||
207 | $query = $this->db |
|
208 | ->select('category.*, route.url, route.parent_url') |
|
209 | ->order_by('category.position', 'ASC') |
|
210 | ->where('category.id', $id) |
|
211 | ->join('route', 'category.route_id = route.id') |
|
212 | ->get('category'); |
|
213 | ||
214 | if ($query->num_rows() > 0) { |
|
215 | $categories = $query->row_array(); |
|
216 | ||
217 | return $categories; |
|
218 | } |
|
219 | ||
220 | return FALSE; |
|
221 | } |
|
222 | ||
223 | /** |
|
224 | * @param int $id |