codeigniter-base-model
codeigniter-base-model copied to clipboard
Created functions to make possible to create static methods on models
Created functions to make possible to create static methods on models, using a static variable that is an instance of the current class and can be used to access the codeigniter methods based on objects. Would be like:
static function find($id){ self::getInstance()->db->where("id", $id); $result = self::getInstance()->db->get("user")->result(); return count($result) == 1 ? $result[0] : null; }
And can be called by $user = User::find(10);