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


PHP Model::__unset方法代碼示例

本文整理匯總了PHP中yii\base\Model::__unset方法的典型用法代碼示例。如果您正苦於以下問題:PHP Model::__unset方法的具體用法?PHP Model::__unset怎麽用?PHP Model::__unset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在yii\base\Model的用法示例。


在下文中一共展示了Model::__unset方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __unset

 /**
  * Unsets property or item.
  *
  * @param string $name the property name or the event name
  */
 public function __unset($name)
 {
     if ($name && $this->canSetProperty($name)) {
         parent::__unset($name);
     } else {
         $this->unsetItem($name);
     }
 }
開發者ID:heartshare,項目名稱:yii2-collection,代碼行數:13,代碼來源:Model.php

示例2: __unset

 /**
  * Sets a component property to be null.
  * This method overrides the parent implementation by clearing
  * the specified attribute value.
  * @param string $name the property name or the event name
  */
 public function __unset($name)
 {
     if ($this->hasAttribute($name)) {
         unset($this->_attributes[$name]);
     } elseif (array_key_exists($name, $this->_related)) {
         unset($this->_related[$name]);
     } elseif ($this->getRelation($name, false) === null) {
         parent::__unset($name);
     }
 }
開發者ID:selenzo,項目名稱:bsuir,代碼行數:16,代碼來源:BaseActiveRecord.php

示例3: __unset

 /**
  * @inheritdoc
  */
 public function __unset($name)
 {
     if (array_key_exists($name, $this->_attributes)) {
         unset($this->_attributes[$name]);
     } else {
         parent::__unset($name);
     }
 }
開發者ID:diandianxiyu,項目名稱:Yii2Api,代碼行數:11,代碼來源:DynamicModel.php

示例4: __unset

 /**
  * Sets a component property to be null.
  * This method overrides the parent implementation by clearing
  * the specified attribute value.
  * @param string $name the property name or the event name
  */
 public function __unset($name)
 {
     if (!$this->setAttributeInternal($name, null)) {
         if (array_key_exists($name, $this->_related)) {
             unset($this->_related[$name]);
         } elseif ($this->getRelation($name, false) === null) {
             parent::__unset($name);
         }
     }
 }
開發者ID:Wookashlab,項目名稱:MainRepo,代碼行數:16,代碼來源:BaseActiveRecord.php

示例5: __unset

 /**
  * Sets a component property to be null.
  * This method overrides the parent implementation by clearing
  * the specified attribute value.
  * @param string $name the property name or the event name
  */
 public function __unset($name)
 {
     if ($this->hasAttribute($name)) {
         unset($this->_attributes[$name]);
     } else {
         if (isset($this->_related[$name])) {
             unset($this->_related[$name]);
         } else {
             parent::__unset($name);
         }
     }
 }
開發者ID:davidpersson,項目名稱:FrameworkBenchmarks,代碼行數:18,代碼來源:BaseActiveRecord.php

示例6: __unset

 /**
  * Sets a component property to be null.
  * This method overrides the parent implementation by clearing
  * the specified attribute value.
  * @param string $name the property name or the event name
  */
 public function __unset($name)
 {
     if ($this->hasAttribute($name)) {
         unset($this->_attributes[$name]);
     } elseif ($this->getRelation($name, false) === null) {
         parent::__unset($name);
     }
 }
開發者ID:Liv1020,項目名稱:cms,代碼行數:14,代碼來源:RelatedPropertiesModel.php


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