I never saw the need for this as it is pretty easy to implement this. Either with specific find() method extensions per model or with a more generic extension in your own base model extending Orm\Model. Something like:Some people already asked for this I think. The idea is to add some sort of before_find() or before_where(), which are not observers because they don't work with an instance but rather on a global level within static calls. For example a publication system could create a special 'is_published' filter which will act on 2 columns date_publication_start and date_publication_end to fulfil the custom condition. This filter / condition would be usable in the find() method, or from the $query->where() method, or applied from a related model.
public static function find() { $args = func_get_args(); method_exists($this, 'before_find') and $args = call_user_func_array(array($this, 'before_find'), $args); $result = call_user_func_array('parent::find', $args); method_exists($this, 'after_find') and $result = call_user_func(array($this, 'after_find'), $result); return $result; }But it's up to you on how to do this exactly. Behaviours
Best thing would be to fork it and maintain it. Being in legacy mode we won't add functionality and won't accept any new functionality as we'd be responsable for maintaining and supporting those as well. If you fork it you can take the responsibility for those and if your fork proves successfull and sustained in maintainance we'll link our old repo to yours. Which would probably be the best outcome for a life after 1.0 for the ORM.We could implement those functionalities to improve the ORM (and break the "legacy mode" ). in that case, we'll need your support and expertise to make a good implementation, to follow the guidelines and the Fuel's philosophy and to have a nice API for all that.
As we've already been working on it, we don't really aim at a big effort / investment on your side. We'll happily do the dirty work, but we need your help to make it into the Core properly.
It looks like you're new here. If you want to get involved, click one of these buttons!