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


PHP CApplicationComponent::__set方法代碼示例

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


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

示例1: __set

 public function __set($name, $value)
 {
     if ($this->hasState($name)) {
         $this->setState($name, $value);
     } else {
         parent::__set($name, $value);
     }
 }
開發者ID:smokeelow,項目名稱:faicore,代碼行數:8,代碼來源:yiilite.php

示例2: __set

 /**
  * Magic set method. If a set<Name> method exists, then it is called.
  * Otherwise, pass to the parent
  *
  * @param string $name
  * @param mixed $value
  */
 public function __set($name, $value)
 {
     $name = str_replace('_', '', $name);
     parent::__set($name, $value);
 }
開發者ID:mafiu,項目名稱:listapp,代碼行數:12,代碼來源:GeoCoder.php

示例3: __set

 /**
  * Sets value of a component property.
  * Do not call this method. This is a PHP magic method that we override
  * to allow using the following syntax to set a property
  * <pre>
  * $this->propertyName=$value;
  * </pre>
  * @param string $name the property name
  * @param mixed $value the property value
  * @return mixed
  * @throws CException if the property is not defined or the property is read only.
  * @see __get
  */
 public function __set($name, $value)
 {
     $setter = 'set' . $name;
     if (property_exists($this->getClient(), $name)) {
         return $this->getClient()->{$name} = $value;
     } elseif (method_exists($this->getClient(), $setter)) {
         return $this->getClient()->{$setter}($value);
     }
     return parent::__set($name, $value);
 }
開發者ID:rubipikachu,項目名稱:xoso-lechung,代碼行數:23,代碼來源:ARedisConnection.php

示例4: __set

 /**
  * @param string $strName
  * @param mixed $mixValue
  * @return mixed
  */
 public function __set($strName, $mixValue)
 {
     switch ($strName) {
         case 'cartItems':
             return $this->model->cartItems;
         default:
             // As a clever trick to get to our model through the component,
             if ($strName != "model" && $this->model->hasAttribute($strName)) {
                 $this->model->__set($strName, $mixValue);
             } else {
                 return parent::__set($strName, $mixValue);
             }
     }
 }
開發者ID:hjlan,項目名稱:webstore,代碼行數:19,代碼來源:ShoppingCart.php


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