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 ? :)
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)
June 27 2010
December 21, 2012
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 ? :)