fuel_model returning empty?
I have a simple module and it works on the backend. I added one record, but now when I call the model from the frontend, my query returns empty:
$vars['display'] = fuel_model('gallery', array('find' => 'all'));
var_dump($vars['display']);
This returns empty. Any idea why? What can I change in my model that might be affecting this?
Thanks in advance!
Comments
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); require_once(FUEL_PATH.'models/base_module_model.php'); class Gallery_model extends Base_module_model { public $required = array(); function __construct() { parent::__construct('zwell_gallery'); // table name $this->load->model('galleryvariables_model'); } function list_items($limit = NULL, $offset = NULL, $col = 'zwell_gallery.master_order', $order = 'DESC') { $this->db->select('id, slug, layout, published, featured', FALSE); $data = parent::list_items($limit, $offset, $col, $order); return $data; } function _common_query() { parent::_common_query(); // to do active and published $this->db->order_by('master_order DESC'); } } ?>
My 'published' field was set to TINYINT(1, 0) rather than ENUM('yes', 'no'), so my queries were never seeing the published records.