jlorente/yii2-activerecord-inheritance

getAttributes throws UnknownPropertyException

haraldglaser opened this issue · 2 comments

When calling getAttributes() with parameter $names and requesting a field of the child model, an UnknownPropertyException gets thrown, because parameter $names is used unmodified in $this->_parent()->getAttributes($names, $except)

It should be filtered to only contain field names of the parent model.

Makes sense. I will correct the problem.

Now ::getAttributes() is working correctly. If the argument $names is null it is filled with all of the attributes names of parent and child and passed to the parent::getAttributes() method. The rest is done by the trait itself.