(1-1/1)
Something like:
class myModel extends ActiveRecord\Model
{
static $table_name = 'blog';
public static function get_single_post($id)
{
return self::find_by_id($id);
}
}
(1-1/1)
June 27 2010
August 26, 2013
Subject: MVC - model separated logic?
Hi Kien,
I would like to get all my database logic separated from my Controllers and Views, as it should in a proper MVC pattern.
How can I accomplish this with php.activerecord?
I've tried to make a nested model like this, but I keep getting errors when I need to access the static functions and variables (finders, updaters and so on).
Running the stable 1.0 version on PHP 5.3