Scalr\Model\AbstractEntity::__set PHP Method

__set() public method

public __set ( $prop, $value )
    public function __set($prop, $value)
    {
        if (property_exists($this, $prop)) {
            $this->{$prop} = $value;
            return $this;
        }
        throw new BadMethodCallException(sprintf('Property "%s" does not exist for the class "%s".', $prop, get_class($this)));
    }

Usage Example

Example #1
0
 /**
  * {@inheritdoc}
  * @see AbstractEntity::__set()
  */
 public function __set($name, $value)
 {
     switch ($name) {
         case 'metric':
             $this->_metric = $value;
             break;
         default:
             parent::__set($name, $value);
     }
 }