Hi,
I have a model (UserBase) + a behaviors (FavorisBehavior)
I attach the behavior to the model using behaviors(). So model now has behavior’s method.
Now I’d like to had the behavior to add a relation to the model. But I failled.
How can a behavior define a new relation in the model it is attached ?
New relation code is
$this->owner->metaData->addRelation(
'_favoris' ,
array(self::HAS_MANY, 'Favoris', 'creation_user')
);
$this->owner->refreshMetaData();