CodeIgniter-MY_Model
CodeIgniter-MY_Model copied to clipboard
Base model (MY_Model) for the Codeigniter framework.
Hi, I can't use methos like and select this is the menssage: No method with that name (select) in MY_Model or CI_Model. And No method with that name (like) in...
Say I have this as example ``$this->country_model->with_cities(array('fields'=>'name,id,population','with'=>array('relation'=>'companies','fields'=>'name,phone_number'))->get($country_id);`` But I have another relationship with many locations and I want that location to be pulled as well. How do i do that?...
I was wondering if we can select what to sort by and the sort order of pagination? Thanks.
Hi, certainly miss understood. I just try to get POSTS with PROMOTION, so excluding POST without Promotion, as i do with a basic sql query (SELECT * FROM posts INNER...
Hi, I have a relationship query and I need to order the results base on the relation model. Here is my query: ``` $this->c_model->where(['user_id' => 1]) ->with_exam('order_by:date,asc') ->get_all(); ``` Then...
Hi ! I got an error when trying to do next query: ``` $where = array( 'is_active' => array(0,1), 'name !=' => 'fulltrack' ); $result = $this->test_model->where($where)->get_all(); ```  So...
$this->soft_deletes = true; This is not affect the count_row function. Quick fix: ``` php public function count_rows($where = NULL)` { if(isset($where)) { $this->where($where); } /*add this*/ elseif($this->soft_deletes===TRUE) { $this->_where_trashed(); }...
When i try to use this method: `$this->with_eventos('fields: \*count\* ')->get_all()` - where 'eventos' is a relationship of has one. This method takes me this error: > Severity: Warning > Message:...
In my models's __construct() is class xxxx_model extends MY_Model { public function __construct() { $this->_database_connection = 'rptdb'; parent::__construct(); parent::on('rptdb'); } public function search($columns, $param = array(), $sort = array(), $limit...
On the docs you mention that you can do this type of update where you can increment 1 field. ``` php $this->update(array('wins'=>'wins+1'), array('user_id' => $user_id), FALSE); ``` Im getting this...