예제 #1
0
 public function __set($name, $value)
 {
     if ($this->hasState($name)) {
         $this->setState($name, $value);
     } else {
         parent::__set($name, $value);
     }
 }
예제 #2
0
파일: GeoCoder.php 프로젝트: mafiu/listapp
 /**
  * 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);
 }
예제 #3
0
 /**
  * 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);
 }
예제 #4
0
 /**
  * @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);
             }
     }
 }