The default implementation will unset the [[owner]] property
and detach event handlers declared in [[events]].
Make sure you call the parent implementation if you override this method.
public detach ( ) |
public function detach() { /** @var UpdateAction $owner */ $owner = $this->owner; $owner->controller->off(Controller::EVENT_AFTER_ACTION, [$this, 'handleConflict']); Event::off(ActiveRecord::className(), ActiveRecord::EVENT_INIT, [$this, 'onActiveRecordInit']); parent::detach(); }
public function detach() { /** @var ActiveRecord $model */ $model = $this->owner; $model->detachBehavior('syncableFormattedTimestamps'); $model->detachBehavior('syncableTimestamp'); parent::detach(); }
/** * Detaches the entity from a component */ public function detach() { parent::detach(); if (method_exists($this->owner, "getPrimaryKey")) { $this->name = $this->_oldName; } }
public function detach() { Event::off(ActiveQuery::className(), ActiveQuery::EVENT_INIT, [$this, 'applyLatestOnlyCondition']); parent::detach(); }
/** * @inheritdoc */ public function detach() { if ($this->via !== null) { $this->owner->detachBehavior($this->viaId()); } if (!$this->oneToMany) { $ownerValidators = $this->owner->validators; $cleanValidators = []; //Get clean validators foreach ($ownerValidators as $validator) { if (!in_array($validator, $this->validators)) { $cleanValidators[] = $validator; } } //Exchange owner validator array with clean ones $ownerValidators->exchangeArray($cleanValidators); } parent::detach(); }
/** * @inheritdoc */ public function detach() { parent::detach(); //$this->removeValidator(); }