本文整理匯總了PHP中CComponent::__get方法的典型用法代碼示例。如果您正苦於以下問題:PHP CComponent::__get方法的具體用法?PHP CComponent::__get怎麽用?PHP CComponent::__get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CComponent
的用法示例。
在下文中一共展示了CComponent::__get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __get
/**
* @param string $key
* @return mixed
*/
public function __get($key)
{
if ($this->exists($key)) {
return $this->get($key);
}
return parent::__get($key);
}
示例2: __get
public function __get($name)
{
if (in_array($name, EFileMetaData::$attributeLabels)) {
return $this->getMetaData()->getAttribute($name);
}
return parent::__get($name);
}
示例3: __get
/**
* Getter magic method.
* This method is overridden to support accessing application components
* like reading module properties.
* @param string $name application component or property name
* @return mixed the named property value
*/
public function __get($name)
{
if ($this->hasComponent($name)) {
return $this->getComponent($name);
} else {
return parent::__get($name);
}
}
示例4: __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);
}
}
示例5: __get
/**
* Any requests to set or get attributes or call methods on this class that
* are not found are redirected to the {@link Swift_Mime_Message} object.
* @param string the attribute name
*/
public function __get($name)
{
try {
return parent::__get($name);
} catch (CException $e) {
$getter = 'get' . $name;
if (method_exists($this->message, $getter)) {
return $this->message->{$getter}();
} else {
throw $e;
}
}
}
示例6: __get
public function __get($name)
{
try {
return parent::__get($name);
} catch (CException $e) {
$method_name = Yii::app()->text->underscoreToCamelcase($name);
$method_name = 'get' . ucfirst($method_name);
if (method_exists($this, $method_name)) {
return $this->{$method_name}();
} else {
throw new CException($e->getMessage());
}
}
}
示例7: __get
public function __get($name)
{
return parent::__get($name);
}
示例8: __get
public function __get($name)
{
if (isset($this->_attributes[$name])) {
return $this->_attributes[$name];
} else {
if (isset($this->_match[$name])) {
return $this->_match[$name];
} else {
return parent::__get($name);
}
}
}
示例9: __get
/**
* Overrides the default magic method defined at the CComponent level in order to
* return a metadata value if parent method fails.
*
* @see CComponent::__get()
*/
public function __get($name)
{
try {
return parent::__get($name);
} catch (CException $e) {
if (isset($this->_metadata[$name])) {
return $this->_metadata[$name];
} else {
throw new SWException('Property "' . $name . '" is not found.', SWException::SW_ERR_ATTR_NOT_FOUND);
}
}
}
示例10: __get
public function __get($name)
{
$getter = 'get' . $name;
if (false !== method_exists($this, $getter)) {
return call_user_func(array($this, $getter));
} else {
if (false !== property_exists($this, $name)) {
return $this->{$name};
} else {
if (false !== $this->getIsProxy() && false !== method_exists($this->_instance, $getter)) {
return call_user_func(array($this->_instance, $getter));
} else {
if (false !== $this->getIsProxy() && false !== property_exists($this->_instance, $name)) {
return $this->_instance->{$name};
} else {
if (false === $this->getIsProxy() && false !== array_key_exists($name, $this->abstract)) {
return $this->abstract[$name];
}
}
}
}
}
return parent::__get($name);
}
示例11: __get
public function __get($strName)
{
switch ($strName) {
case 'Name':
return $this->name();
case 'AdminName':
return $this->adminName();
case 'DefaultName':
return $this->defaultName;
case 'advancedMode':
return $this->advancedMode;
case 'modulename':
return $this->getModuleName();
case 'uses_credit_card':
return $this->uses_credit_card;
case 'uses_jumper':
return $this->uses_jumper;
default:
return parent::__get($strName);
}
}
示例12: __get
/**
* Overrides the default magic method defined at the CComponent level in order to
* return a metadata value if parent method fails.
*
* @see CComponent::__get()
*/
public function __get($name)
{
try {
return parent::__get($name);
} catch (CException $e) {
if (isset($this->_metadata[$name])) {
return $this->_metadata[$name];
} else {
throw new SWException(Yii::t('yii', 'Property "{property}" is not found.', array('{property}' => $name)), SWException::SW_ERR_ATTR_NOT_FOUND);
}
}
}
示例13: __get
/**
* @param string $name
* @return mixed
*/
public function __get($name)
{
$parts = explode(self::ATTRIBUTE_NAME_PREFIX, $name);
if (count($parts) == 2 && $parts[1] != null) {
return $this->resolveValueFromModel($parts[1]);
}
//Not using isset, because a null value would not resolve correctly
if (array_key_exists($name, $this->selectedColumnNamesAndValues)) {
return $this->selectedColumnNamesAndValues[$name];
}
return parent::__get($name);
}
示例14: __get
/**
* (non-PHPdoc)
* @see CComponent::__get()
*/
public function __get($name)
{
if (null !== $this->_results && isset($this->_results[$name])) {
return $this->_results[$name];
}
return parent::__get($name);
}
示例15: __get
public function __get($name)
{
if ($name == 'magic_get_prop' || $name == 'other_magic_get_prop') {
return 'foo';
}
return parent::__get($name);
}