當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Behavior::detach方法代碼示例

本文整理匯總了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();
 }
開發者ID:zarv1k,項目名稱:yii2-two-way-sync,代碼行數:8,代碼來源:UpdateConflictBehavior.php

示例2: detach

 public function detach()
 {
     /** @var ActiveRecord $model */
     $model = $this->owner;
     $model->detachBehavior('syncableFormattedTimestamps');
     $model->detachBehavior('syncableTimestamp');
     parent::detach();
 }
開發者ID:zarv1k,項目名稱:yii2-two-way-sync,代碼行數:8,代碼來源:SyncableBehavior.php

示例3: detach

 /**
  * Detaches the entity from a component
  */
 public function detach()
 {
     parent::detach();
     if (method_exists($this->owner, "getPrimaryKey")) {
         $this->name = $this->_oldName;
     }
 }
開發者ID:highestgoodlikewater,項目名稱:yii2-liuxy-extension,代碼行數:10,代碼來源:ARedisEntity.php

示例4: detach

 public function detach()
 {
     Event::off(ActiveQuery::className(), ActiveQuery::EVENT_INIT, [$this, 'applyLatestOnlyCondition']);
     parent::detach();
 }
開發者ID:zarv1k,項目名稱:yii2-two-way-sync,代碼行數:5,代碼來源:IndexLatestBehavior.php

示例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();
 }
開發者ID:alesar-code,項目名稱:yii2-base,代碼行數:22,代碼來源:RelationBehavior.php

示例6: detach

 /**
  * @inheritdoc
  */
 public function detach()
 {
     parent::detach();
     //$this->removeValidator();
 }
開發者ID:vadimsemenykv,項目名稱:yii2-file-processor-module,代碼行數:8,代碼來源:UploadBehavior.php


注:本文中的yii\base\Behavior::detach方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。