jamierumbelow/codeigniter-base-model — pull request #182 by etcho (2014-09-17 12:53:35+00:00)
Title: 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);