| @@ 250-267 (lines=18) @@ | ||
| 247 | * @param null|string $locale |
|
| 248 | * @return bool |
|
| 249 | */ |
|
| 250 | public function get_image_info($id, $locale = null) { |
|
| 251 | ||
| 252 | if (null === $locale) { |
|
| 253 | $locale = $this->chose_locale(); |
|
| 254 | } |
|
| 255 | ||
| 256 | $this->db->limit(1); |
|
| 257 | $this->joinI18n($this->db, 'gallery_images', $locale); |
|
| 258 | $this->db->select('*, gallery_images.id as id'); |
|
| 259 | $this->db->where('gallery_images.id', $id); |
|
| 260 | $query = $this->db->get('gallery_images'); |
|
| 261 | ||
| 262 | if ($query->num_rows() == 1) { |
|
| 263 | return $query->row_array(); |
|
| 264 | } else { |
|
| 265 | return FALSE; |
|
| 266 | } |
|
| 267 | } |
|
| 268 | ||
| 269 | /** |
|
| 270 | * @param int $id |
|
| @@ 328-343 (lines=16) @@ | ||
| 325 | return $this->db->insert_id(); |
|
| 326 | } |
|
| 327 | ||
| 328 | public function get_category($id, $locale = null) { |
|
| 329 | if (null === $locale) { |
|
| 330 | $locale = $this->chose_locale(); |
|
| 331 | } |
|
| 332 | $this->db->limit(1); |
|
| 333 | $this->db->where('gallery_category.id', $id); |
|
| 334 | $this->db->select('*, gallery_category.id as id'); |
|
| 335 | $this->joinI18n($this->db, 'gallery_category', $locale); |
|
| 336 | $query = $this->db->get('gallery_category'); |
|
| 337 | ||
| 338 | if ($query->num_rows() == 1) { |
|
| 339 | return $query->row_array(); |
|
| 340 | } else { |
|
| 341 | return FALSE; |
|
| 342 | } |
|
| 343 | } |
|
| 344 | ||
| 345 | /** |
|
| 346 | * @param CI_DB_mysqli_driver|CI_DB_mysql_driver $con |
|