michail1982

Results 30 comments of michail1982

write method ``` php public function select($what = '*', $escape = true) { $this->_database->select($what, $escape); return $this; } ``` usage ``` php $this->article_model->select('id, title')->get_all(); ```

http://www.codeigniter.com/user_guide/database/query_builder.html implementation (in MY_Model) ``` php public function like($field, $match = '', $side = 'both', $escape = NULL) { $this->_database->like($field, $match, $side, $escape); return $this; } ```

@upcesar , use $this->_database instate of $this->db

@paulcanning check MY_Model version . i think it`s happends on empty results (closed issue) check this line https://github.com/jamierumbelow/codeigniter-base-model/blob/master/core/MY_Model.php#L441

@paulcanning Sure, its return model object and you can call get() or get_all() or any other MY_Model method

``` php $this->model->with('owner')->my_custom_query_method()->get_many_by(('score' => 1)); ```

@paulcanning , ``` php return $this; ```

@absmugz you can write method ``` php Class My_mega_model extends MY_Model { //Add line below, if you always need join`s protected $before_get = array('with_my_stuff'); public function with_my_stuff() { //here you...

check docs. before_get must accept and return $row my example explaining idea ;)

@paulcanning i know)) . my example can be used in case ``` php $this->my_mega->model->with_my_stuff()->get();/// or any other AR method ``` when with_my_stuff in before_get array method must receive and return...