__get() публичный Метод

Do not call this method directly as it is a PHP magic method that will be implicitly called when executing $value = $object->property;.
См. также: __set()
public __get ( string $name ) : mixed
$name string the property name
Результат mixed the property value
Пример #1
0
 public function __get($property)
 {
     if ($this->isNestedProperty($property)) {
         return $this->getNestedProperty($property);
     }
     return parent::__get($property);
 }
Пример #2
0
 /**
  * (non-PHPdoc)
  * @see \yii\base\Object::__get()
  */
 public function __get($name)
 {
     if (in_array($name, $this->options)) {
         return $this->config->{$name};
     }
     return parent::__get($name);
 }
 /**
  * Check whether we have a plugin installed with that name previous firing up the call
  *
  * @param string $name
  *
  * @return mixed|void
  */
 public function __get($name)
 {
     if (ArrayHelper::keyExists($name, $this->getInstalledPlugins())) {
         return $this->getPlugin($name);
     }
     return parent::__get($name);
 }
Пример #4
0
 /**
  * @inheritdoc
  */
 public function __get($name)
 {
     if (array_key_exists($name, $this->_color)) {
         return $this->_color[$name];
     }
     return parent::__get($name);
 }
Пример #5
0
 public function __get($name)
 {
     if (isset($this->_user[$name])) {
         return $this->_user[$name];
     }
     return parent::__get($name);
 }
Пример #6
0
 /**
  * @inheritdoc
  */
 public function __get($name)
 {
     $config = $this->getFieldsConfig();
     if (isset($config[$name]) and is_array($config[$name])) {
         return $this->getField($name);
     }
     return parent::__get($name);
 }
Пример #7
0
 /**
  * PHP getter magic method.
  * This method is overridden so that service attributes can be accessed like properties.
  *
  * @param string $name property name.
  * @return mixed property value.
  * @see getAttribute
  */
 public function __get($name)
 {
     if ($this->hasAttribute($name)) {
         return $this->getAttribute($name);
     } else {
         return parent::__get($name);
     }
 }
Пример #8
0
 /**
  * Returns the value of a property.
  *
  * @param string $name the property name
  * @return mixed the property value
  * @throws UnknownPropertyException if the property is not defined
  */
 public function __get($name)
 {
     if (isset($this->_data[$name])) {
         return $this->_data[$name];
     } else {
         return parent::__get($name);
     }
 }
Пример #9
0
 /**
  * Returns the value of an object property.
  *
  * Do not call this method directly as it is a PHP magic method that
  * will be implicitly called when executing `$value = $object->property;`.
  * @param string $name the property name
  * @return mixed the property value
  * @throws UnknownPropertyException if the property is not defined
  * @throws InvalidCallException if the property is write-only
  * @see __set()
  */
 public function __get($name)
 {
     if (property_exists($this->instance, $name)) {
         return $this->instance->{$name};
     }
     return parent::__get($name);
     // TODO: Change the autogenerated stub
 }
Пример #10
0
 /**
  *
  * @see \yii\base\Object::__get()
  * @param string $name
  * @return mixed
  * @throws WorkflowException
  */
 public function __get($name)
 {
     if ($this->canGetProperty($name)) {
         return parent::__get($name);
     } elseif ($this->hasMetadata($name)) {
         return $this->_metadata[$name];
     } else {
         throw new WorkflowException("No metadata found is the name '{$name}'");
     }
 }
Пример #11
0
 public function __get($name)
 {
     if ($this->_payload && isset($this->_payload[$name])) {
         return $this->_payload[$name];
     } else {
         if (isset($this->{$name})) {
             return parent::__get($name);
         } else {
             throw new \yii\base\Exception("The '" . $name . "' attribute " . "was not found in CrugeIdentity or in its Payload.");
         }
     }
 }
Пример #12
0
 /**
  * @param string $name
  * @param array $params
  * @return mixed
  * @throws \yii\base\UnknownPropertyException
  */
 public function __call($name, $params)
 {
     if (method_exists($this->model, $name)) {
         return call_user_func_array([$this->model, $name], $params);
     }
     foreach ($this->model->behaviors as $behavior) {
         if (method_exists($behavior, $name)) {
             return call_user_func_array([$this->model, $name], $params);
         }
     }
     return parent::__get($name);
 }
 /**
  * @inheritdoc
  */
 public function __get($name)
 {
     // getters go first
     $getter = 'get' . $name;
     if (method_exists($this, $getter)) {
         return $this->{$getter}();
     }
     return ArrayHelper::keyExists($name, $this->options) ? $this->options[$name] : parent::__get($name);
 }
Пример #14
0
 /**
  * @param string $name
  * @return ParamsObject|mixed|null
  * @throws UnknownPropertyException
  */
 public function __get($name)
 {
     try {
         return parent::__get($name);
     } catch (UnknownPropertyException $e) {
         return $this->params($name);
     }
 }
Пример #15
0
 /**
  * @inheritdoc
  */
 public function __get($name)
 {
     return parent::__get(Inflector::camelize($name));
 }