codeigniter-base-model
codeigniter-base-model copied to clipboard
⛔️DEPRECATED CodeIgniter base CRUD model to remove repetition and increase productivity
Added the condition to adapt both method to be coherent with their counterparts get_many_by() and get_all(). I'm not sure if the count_all solution is the best, because it could be...
model.. class Birrequest_model extends MY_Model { ``` public $_table = 'bir_request'; public $validate = array( array( 'field' => 'salesorder', 'rules' => 'required' ), array( 'field' => 'clientemail', 'rules' => 'required|valid_email')...
The $this->db->like('name','david') was not support? Or use $before_get function ? I wrote it myself?
The trigger 'before_update' should be called after validation. Example: If you are trying to confirm a password field before update a record, validation will pass if you don't unset the...
Something like this: ``` php $from = strtotime('yesterday'); $to = strtotime('today'); $this->blog_model->get_by_date_range($from,$to)->limit(10); ``` This would look at 'created_at' and do the equivalent of this: ``` php $this->db->where("UNIX_TIMESTAMP(created_at)>=".$from); $this->db->where("UNIX_TIMESTAMP(created_at)
The documentation explains how to set up a one-to-many relationship, but who would I do a one to one relationship, when one table is involved in a one-to-many relationship with...
Hi! Using latest github code and codeigniter version 2.1.4, when i copy MY_Model.php file into application/core even when i'm not actually using MY_Model in any of my models i get...
Many lines of code would be saved if we could catch simple errors with the base model and have an error message echoed and/or logged. You know all those infrequent...
Is there any way to limit database results for relate model? For example: $this->some_model_one->with('some_model_two')->get('model_one_primary_key'). I want to limit number of 'some_model_two' results. Model one has_many of some_model_two.
First of all: thanks for your awesome model!! If I need a first record of an ordered set I use: ``` php $this->$model->order_by($order_bys) ->$model->get_by(array()); ``` Because get() expects an primary...