Евгений Суворов Thu Feb 27 07:16:14 -0500 2014

Subject: Doesn't work ActiveRecord

Hi!

I have a problem.

It's my code:
class Books extends ActiveRecord\Model {
function _construct(){
parent::
_construct();
}
}

And call:
print_r(Books::first()->attributes());

If class Books has magic method "__construct" method "Books::first()" returns empty result.
How can I do correctly work ActewRecord with method "__construct" in my class?


Adam K Tue May 13 23:40:30 -0400 2014

Is there any particular reason you need __construct() ? It might be worth looking at the callbacks and using the before_create callback.

(1-1/1)