public function __set($name, $value)
 {
     if (in_array($name, ['creditCard_number', 'creditCard_expirationDate', 'creditCard_cvv'])) {
         $this->_attributes[$name] = $value;
     }
     return parent::__set($name, $value);
 }
Exemple #2
0
 /**
  * Sets property or item.
  *
  * @param string $name  item or property name
  * @param string $value value to be set
  *
  * @return mixed item of found or the named property value
  */
 public function __set($name, $value)
 {
     if ($name && $this->canSetProperty($name)) {
         parent::__set($name, $value);
     } else {
         $this->setItem($name, $value);
     }
 }
Exemple #3
0
 /**
  * @brief 设置某个属性值 PHP magic function
  *
  * @return  public function 
  * @retval   
  * @see 
  * @note 
  * @author 吕宝贵
  * @date 2016/03/07 15:49:36
  **/
 public function __set($name, $value)
 {
     if ($this->hasAttribute($name)) {
         $this->_attributes[$name] = $value;
     } else {
         parent::__set($name, $value);
     }
 }
Exemple #4
0
 public function __set($name, $value)
 {
     if (stripos($name, 'attr') === 0) {
         $this->attr[$name] = $value;
     } else {
         parent::__set($name, $value);
     }
 }
Exemple #5
0
 public function __set($name, $value)
 {
     if (array_key_exists($name, array_flip($this->extraAttributes))) {
         $this->extraAttributesData[$name] = $value;
     } else {
         parent::__set($name, $value);
     }
 }
Exemple #6
0
 /**
  * @param string $name
  * @param mixed $value
  */
 public function __set($name, $value)
 {
     $_name = explode('.', $name);
     if (count($_name) == 2) {
         $this->_attributes[$name] = $value;
     } else {
         parent::__set($name, $value);
     }
 }
Exemple #7
0
 /**
  * @inheritdoc
  */
 public function __set($name, $value)
 {
     if (is_array($value)) {
         $value = array_map('trim', $value);
     } elseif (is_string($value)) {
         $value = trim($value);
     }
     if (isset($this->attrStorage[$name])) {
         $this->attrStorage[$name] = $value;
         return true;
     }
     return parent::__set($name, $value);
 }
Exemple #8
0
 public function __set($name, $value)
 {
     if (isset($this->models[$name])) {
         $this->models[$name] = $value;
         return;
     }
     foreach ($this->models as $model) {
         if ($model->hasAttribute($name)) {
             $model->setAttribute($name, $value);
             return;
         }
     }
     parent::__set($name, $value);
 }
Exemple #9
0
 public function __set($propertyName, $propertyValue)
 {
     if ($this->canSetProperty($propertyName)) {
         return parent::__set($propertyName, $propertyValue);
     }
     try {
         return $this->item->{$propertyName} = $propertyValue;
     } catch (\Exception $e) {
     }
     try {
         $t = $this->item->data;
         $t->{$propertyName} = $propertyValue;
         return $this->item->data = $t;
     } catch (\Exception $e) {
     }
 }
Exemple #10
0
 /**
  * @param string $name
  * @param mixed $value
  */
 public function __set($name, $value)
 {
     if (isset($this->attributes[$name])) {
         $this->attributes[$name] = $value;
     } else {
         parent::__set($name, $value);
     }
 }
Exemple #11
0
 public function __set($name, $value)
 {
     if (in_array($name, $this->getClientAttributes())) {
         return $this->_entity->{$name} = $value;
     }
     return parent::__set($name, $value);
 }
Exemple #12
0
 /**
  * @inheritdoc
  */
 public function __set($name, $value)
 {
     if (array_key_exists($name, $this->_attributes)) {
         $this->_attributes[$name] = $value;
     } else {
         parent::__set($name, $value);
     }
 }
 /**
  * PHP setter magic method.
  * This method is overridden so that AR attributes can be accessed like properties.
  * @param string $name property name
  * @param mixed $value property value
  */
 public function __set($name, $value)
 {
     if (!$this->setAttributeInternal($name, $value)) {
         parent::__set($name, $value);
     }
 }
 public function __set($name, $value)
 {
     if ($name == 'scenario') {
         parent::__set($name, $value);
         return;
     }
     if (property_exists(get_class($this), $name)) {
         $this->{$name} = $value;
     } else {
         $this->dynAttributes[$name] = $value;
     }
 }
 public function __set($name, $value)
 {
     try {
         parent::__set($name, $value);
     } catch (UnknownPropertyException $e) {
         if (isset($this->_attr[$name])) {
             $this->_attr[$name] = $value;
         }
     }
 }
Exemple #16
0
 /**
  * PHP setter magic method.
  * This method is overridden so that AR attributes can be accessed like properties.
  * @param string $name property name
  * @param mixed $value property value
  */
 public function __set($name, $value)
 {
     if ($this->hasAttribute($name)) {
         $this->_attributes[$name] = $value;
         if (StringHelper::startsWith($name, $this->extra_field_prefix)) {
             foreach ($this->primaryModel->getExtraFieldValues() as $fieldValue) {
                 if ($this->extra_field_prefix . $fieldValue->getFieldId() === $name) {
                     $fieldValue->value = $value;
                 }
             }
         } else {
             $this->primaryModel->{$name} = $value;
         }
     } else {
         parent::__set($name, $value);
     }
 }
Exemple #17
0
 public function __set($name, $value)
 {
     if (array_key_exists($name, $this->_fieldValues)) {
         return $this->_fieldValues[$name] = $value;
     } else {
         return parent::__set($name, $value);
     }
 }