Loick Pyrech Wed Jan 30 16:46:17 -0500 2013

Subject: Empty attributes

Hi !

I'm desperately trying to implement this activerecord library on my framework. But I only get a "Undefined property" with my models.

I have a parent class like that :

abstract class Model extends\ActiveRecord\Model {
public static $connection = 'mysql';
}

My model looks like :

class Admin extends Model {
public static $table_name = 'core_admin';
}

The connexion with the database seems to be ok because when I debug an Admin::all(), I have the correct number of records :

array (
0 =>
Admin::__set_state(array(
'errors' => NULL,
'attributes' =>
array (
),
'__dirty' => NULL,
'__readonly' => false,
'__relationships' =>
array (
),
'__new_record' => true,
)),

etc

I supposed the problem comes from the empty '$attributes' property but I don't know why and how to resolve it.

Could you help me, please ? :)


Loick Pyrech Mon Feb 11 14:04:11 -0500 2013

As found in another topic, the problem was a constructor that didn't respect the signature of the Activerecord\Model's constructor --'

I hope this topic could help someone in future.

(1-1/1)