I have a base model Modelo
, that has its onConstruct()
:
protected function onConstruct($data = array()) // I also tried with a 'public' modifier.
{
$this->assign($data);
var_dump($data);
}
and a Grade
model that extends from the previous one. My question is, why this isn't working, whenever I put the constructor in the first or second model?
// The 'var_dump()' of the construct method tells 'array(0) {}', wich isn't correct.
$data = array(
'field' => 'value'
);
$grade = new Grade($data);
// This one var dumps the array correctly.
var_dump($data)