Hello,
first, thanks for the great framework! I like the simplicity of this framework and the freedom of writing code very much.
But I have a question regarding best practices to remain my increasing code clear.
Now I use often static functions in my models, like this:
... in my database model "receipts"
public static function getCashdesks()
{
$rows = self::find(array("columns" => "distinct cashdesk"));
$return = array();
if($rows->valid()) {
foreach($rows as $row) {
$return[] = $row->cashdesk;
}
}
return $return;
}
I have read that a big controller is not prefereneced by a lot of programmers so I do this in my models. It works but I am not happy with that.
Where is the best place to do things like this. I can imagine:
-
leave this static functions in the model
-
create an overall (static) class
- blow up the controller
Please help me find the right place.. I am always missing "something" between my controllers and my models, but I can't find a spanning item/class to consolidate.
Thank you, Martin