本文整理汇总了PHP中yii\base\Object::__get方法的典型用法代码示例。如果您正苦于以下问题:PHP Object::__get方法的具体用法?PHP Object::__get怎么用?PHP Object::__get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\base\Object
的用法示例。
在下文中一共展示了Object::__get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __get
public function __get($property)
{
if ($this->isNestedProperty($property)) {
return $this->getNestedProperty($property);
}
return parent::__get($property);
}
示例2: __get
/**
* (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);
}
示例3: __get
/**
* 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: __get
/**
* @inheritdoc
*/
public function __get($name)
{
if (array_key_exists($name, $this->_color)) {
return $this->_color[$name];
}
return parent::__get($name);
}
示例5: __get
public function __get($name)
{
if (isset($this->_user[$name])) {
return $this->_user[$name];
}
return parent::__get($name);
}
示例6: __get
/**
* @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: __get
/**
* 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: __get
/**
* 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: __get
/**
* 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: __get
/**
*
* @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: __get
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: __call
/**
* @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);
}
示例13: __get
/**
* @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: __get
/**
* @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: __get
/**
* @inheritdoc
*/
public function __get($name)
{
return parent::__get(Inflector::camelize($name));
}