<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Banners_m extends MY_Model {

    protected $table = 'banners';
    protected $primary_key = 'bannerId';

    public function __construct() {
        parent::__construct();
    }

    /**
     * Get active banners
     */
    public function getActiveBanners($limit = null) {
        if ($limit) {
            $this->db->limit($limit);
        }
        return $this->db->get($this->table)->result();
    }

    /**
     * Get banner by unique
     */
    public function getByUnique($bannerUnique) {
        return $this->db->where('bannerUnique', $bannerUnique)->get($this->table)->row();
    }
}

