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


PHP Behavior::__set方法代碼示例

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


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

示例1: __set

 public function __set($name, $value)
 {
     if ($this->fileInputName == $name) {
         return $this->_file = $value;
     }
     return parent::__set($name, $value);
 }
開發者ID:zabachok,項目名稱:yii2-hydra,代碼行數:7,代碼來源:FileInput.php

示例2: __set

 public function __set($name, $value)
 {
     if ($this->checkName($name)) {
         $this->setAttributes($value);
     } else {
         parent::__set($name, $value);
     }
 }
開發者ID:ske,項目名稱:yii2-mongodb-embedded,代碼行數:8,代碼來源:AbstractEmbeddedBehavior.php

示例3: __set

 /**
  * @inheritdoc
  */
 public function __set($name, $value)
 {
     try {
         parent::__set($name, $value);
     } catch (\Exception $e) {
         $this->setAttribute($name, $value);
     }
 }
開發者ID:manyoubaby123,項目名稱:imshop,代碼行數:11,代碼來源:EavBehavior.php

示例4: __set

 /**
  * 
  * @param type $name
  * @param type $value
  * @return type
  */
 public function __set($name, $value)
 {
     if ($this->hasAttr($name)) {
         return $this->setAttr($name, $value);
     } else {
         parent::__set($name, $value);
     }
 }
開發者ID:avrahamichler,項目名稱:Highnet,代碼行數:14,代碼來源:AttributesMapBehavior.php

示例5: __set

 /**
  * Make [[$translationAttributes]] writable
  * @param string $name
  * @param mixed $value
  */
 public function __set($name, $value)
 {
     if (in_array($name, $this->translationAttributes)) {
         $this->getTranslation()->{$name} = $value;
     } else {
         parent::__set($name, $value);
     }
 }
開發者ID:maddoger,項目名稱:yii2-core,代碼行數:13,代碼來源:TranslatableModelBehavior.php

示例6: __set

 public function __set($name, $value)
 {
     if ($name == $this->propertyName) {
         $this->setRelationIds($value);
     } else {
         parent::__set($name, $value);
     }
 }
開發者ID:omnilight,項目名稱:yii2-many-many-relation,代碼行數:8,代碼來源:ManyManyRelationBehavior.php

示例7: __set

 public function __set($name, $value)
 {
     if ($this->hasLocalValue($name)) {
         $this->setLocalValue($name, $value);
     } else {
         parent::__set($name, $value);
     }
 }
開發者ID:omnilight,項目名稱:yii2-phonenumbers,代碼行數:8,代碼來源:PhoneNumberBehavior.php

示例8: __set

 public function __set($name, $value)
 {
     if ($this->_relation->canGetProperty($name)) {
         $this->_relation->{$name} = $value;
     } else {
         parent::__set($name, $value);
     }
 }
開發者ID:mdmsoft,項目名稱:yii2-ar-extended,代碼行數:8,代碼來源:ExtendedBehavior.php

示例9: __set

 public function __set($name, $value)
 {
     if ($this->hasAttribute($name)) {
         $this->setAttribute($name, $value);
         return;
     }
     parent::__set($name, $value);
 }
開發者ID:GAMITG,項目名稱:yz2-admin,代碼行數:8,代碼來源:DateRangeFilteringBehavior.php

示例10: __set

 /**
  * @inheritdoc
  */
 public function __set($name, $value)
 {
     if (isset($this->attributes[$name])) {
         $this->owner->{$this->attributes[$name]} = $this->convertToPhysical($value, $name);
     } else {
         parent::__set($name, $value);
     }
 }
開發者ID:mdmsoft,項目名稱:yii2-format-converter,代碼行數:11,代碼來源:BaseConverter.php

示例11: __set

 /**
  * @param string $name
  * @param mixed $value
  * @throws \yii\base\UnknownPropertyException
  */
 public function __set($name, $value)
 {
     if ($this->checkAttribute($name)) {
         $this->voteAttributes[$name] = !is_null($value) ? (int) $value : null;
     } else {
         parent::__set($name, $value);
     }
 }
開發者ID:hauntd,項目名稱:yii2-vote,代碼行數:13,代碼來源:VoteBehavior.php

示例12: __set

 public function __set($name, $value)
 {
     $rels = array_flip($this->directoryAttributes);
     if (isset($rels[$name])) {
         $this->setDirectory($rels[$name], $value);
     } else {
         parent::__set($name, $value);
     }
 }
開發者ID:tsyrya,項目名稱:mybriop,代碼行數:9,代碼來源:DirectoryBehavior.php

示例13: __set

 /**
  * Make [[$attributes]] writable
  * @inheritdoc
  */
 public function __set($param, $value)
 {
     if (isset($this->attributes[$param])) {
         //$this->owner->__set($this->attributes[$param], $this->convertToStoredFormat($value));
         $this->owner->{$this->attributes[$param]} = $this->convertToStoredFormat($value);
     } else {
         parent::__set($param, $value);
     }
 }
開發者ID:iutbay,項目名稱:yii2-behaviors,代碼行數:13,代碼來源:ConverterBehavior.php

示例14: __set

 /**
  * @inheritdoc
  */
 public function __set($name, $value)
 {
     if (stripos($name, 'client') === 0) {
         if (strcasecmp($name, 'clientId') == 0) {
             throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::' . $name);
         }
         $this->setClientProperty(strtolower($name), $value);
     } else {
         parent::__set($name, $value);
     }
 }
開發者ID:mdmsoft,項目名稱:yii2-client-tools,代碼行數:14,代碼來源:ClientBehavior.php

示例15: __set

 /**
  * Make [[$translationAttributes]] writable
  */
 public function __set($name, $value)
 {
     if (in_array($name, $this->translationAttributes)) {
         if (is_array($value) and isset($value['translations'])) {
             foreach ($value['translations'] as $language => $translatedValue) {
                 $this->getTranslation($language)->{$name} = $translatedValue;
             }
         } else {
             $this->getTranslation()->{$name} = $value;
         }
     } else {
         parent::__set($name, $value);
     }
 }
開發者ID:hector-del-rio,項目名稱:yii2-translateable-behavior,代碼行數:17,代碼來源:TranslateableBehavior.php


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