本文整理匯總了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();
}