本文整理汇总了PHP中yii\base\Behavior::detach方法的典型用法代码示例。如果您正苦于以下问题:PHP Behavior::detach方法的具体用法?PHP Behavior::detach怎么用?PHP Behavior::detach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\base\Behavior
的用法示例。
在下文中一共展示了Behavior::detach方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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();
}
示例2: detach
public function detach()
{
/** @var ActiveRecord $model */
$model = $this->owner;
$model->detachBehavior('syncableFormattedTimestamps');
$model->detachBehavior('syncableTimestamp');
parent::detach();
}
示例3: detach
/**
* Detaches the entity from a component
*/
public function detach()
{
parent::detach();
if (method_exists($this->owner, "getPrimaryKey")) {
$this->name = $this->_oldName;
}
}
示例4: detach
public function detach()
{
Event::off(ActiveQuery::className(), ActiveQuery::EVENT_INIT, [$this, 'applyLatestOnlyCondition']);
parent::detach();
}
示例5: 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();
}
示例6: detach
/**
* @inheritdoc
*/
public function detach()
{
parent::detach();
//$this->removeValidator();
}