<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

/**
 * Description of Slider_tmodel
 *
 * @author CIEXT skeleton
 */
class Slider_tmodel extends \Ciext\Model\AbstractTableModel
{

    protected $table = 'slider';
    protected $pkey = 'id_slider';

    public function fetch_by_code($code)
    {
        $res = $this->db
            ->where($this->get_predicates())
            ->select($this->select, $this->select_escape)
            ->where('t.code', $code)
            ->get($this->table . ' t')
            ->row_array();

        // Notify all observers
        $this->notify(__FUNCTION__, ['res' => $res]);

        return $res;
    }
}
