/** * {@inheritdoc} */ public function setEntity(AttributesHolderInterface $entity = null) { $this->relatedEntity = $entity; if ($entity !== null) { $entity->addEAttribute($this); } }
/** * {@inheritdoc} */ public function setEntity(AttributesHolderInterface $entity = null) { if ($entity !== null) { $this->entity_type = Yii::$app->get('typesRegister')->getEntityType(); } $this->relatedEntity = $entity; if ($entity !== null) { $entity->addEAttribute($this); } }