This method will check in the following order and act accordingly:
- a property defined by a getter: return the getter result
- a property of a behavior: return the behavior property value
Do not call this method directly as it is a PHP magic method that
will be implicitly called when executing $value = $component->property;.
/** * 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); }
/** * @inheritdoc */ public function __get($name) { if (property_exists($this->obj, $name)) { return $this->obj->{$name}; } return parent::__get($name); }
protected function getValue($name) { if (isset(static::$_modules[$name])) { return Yii::createObject(static::$_modules[$name]); } return parent::__get($name); }
/** * Getter magic method. * This method is overridden to support accessing components like reading properties. * @param string $name component or property name * @return mixed the named property value */ public function __get($name) { if ($this->has($name)) { return $this->get($name); } else { return parent::__get($name); } }
/** * @param string $name * @return mixed */ public function __get($name) { try { parent::__get($name); } catch (\yii\base\UnknownPropertyException $e) { return $this->mailChimp->{$name}; } }
public function __get($name) { if (property_exists($this->_api, $name)) { return $this->_api->{$name}; } else { return parent::__get($name); } }
/** * Getter magic method. * This method is overridden to support accessing components like reading properties. * @param string $name component or property name * @return mixed the named property value */ public function __get($name) { // 获取component,只要定义中有,就可以拿到 // 未实例化,get方法会去实例化 if ($this->has($name)) { return $this->get($name); } else { return parent::__get($name); } }
/** * Any requests to set or get attributes or call methods on this class that * are not found are redirected to the {@link IService} object. * @param string $name the attribute name * @return mixed * @throws \Exception */ public function __get($name) { try { return parent::__get($name); } catch (\Exception $e) { if (property_exists($this->_service, $name)) { return $this->_service->{$name}; } else { throw $e; } } }
/** * @param $name * @return \Google_Service|mixed */ function __get($name) { if (!isset($this->services[$name])) { return parent::__get($name); } if (null === $this->serviceInstances[$name]) { /** @var \Google_Service $serviceClass */ $serviceClass = $this->services[$name]["class"]; $this->serviceInstances[$name] = new $serviceClass($this->getClient()); } return $this->serviceInstances[$name]; }
public function __get($name) { $property = '_' . $name; if (property_exists($this, $property) && $this->{$property} === null) { $className = '\\' . ucfirst($name); $this->{$property} = new $className($this->_module->account, $this->_module->password); return $this->{$property}; } return parent::__get($name); }
/** * @param string $name * @return mixed * @throws \yii\base\UnknownPropertyException */ public function __get($name) { if (isset($this->objects[$name])) { return $this->objects[$name]; } return parent::__get($name); }
public function __get($name) { return $this->canGetProperty($name) ? parent::__get($name) : $this->getWorker($name); }
public function __get($name) { if ($name != 'Mp' && substr($name, 0, 2) == 'Mp') { $className = 'ashdark\\wechat\\mp\\' . $name; if (class_exists($className)) { if (empty($this->_mp_arr[$name])) { $this->_mp_arr[$name] = new $className(['mp' => $this->getMp()]); } return $this->_mp_arr[$name]; } } return parent::__get($name); }
/** * Returns a property value based on its name. * Do not call this method. This is a PHP magic method that we override * to allow using the following syntax to read a property * <pre> * $value=$component->propertyName; * </pre> * @param string $name the property name * @return mixed the property value * @throws \yii\base\UnknownPropertyException if the property is not defined * @see __set */ public function __get($name) { $getter = 'get' . $name; if (property_exists($this->getClient(), $name)) { return $this->getClient()->{$name}; } elseif (method_exists($this->getClient(), $getter)) { return $this->{$getter}(); } return parent::__get($name); }
/** * @param string $name * @return mixed * @throws UnknownPropertyException */ public function __get($name) { $getter = 'get' . $name; if (method_exists($this->getZabbixObject(), $getter)) { return $this->getZabbixObject()->{$getter}(); } elseif (method_exists($this, $getter)) { return parent::__get($name); } elseif (method_exists($this, 'set' . $name)) { throw new InvalidCallException('Getting write-only property: ' . get_class($this) . '::' . $name); } else { throw new UnknownPropertyException('Getting unknown property: ' . get_class($this) . '::' . $name); } }
/** * Get the value of format pattern of current locale of application. * @param string $name * @return mixed */ public function __get($name) { $pattern = $this->getPattern(); if (isset($pattern[$name])) { return $pattern[$name]; } return parent::__get($name); }