本文整理汇总了PHP中CComponent::__set方法的典型用法代码示例。如果您正苦于以下问题:PHP CComponent::__set方法的具体用法?PHP CComponent::__set怎么用?PHP CComponent::__set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComponent
的用法示例。
在下文中一共展示了CComponent::__set方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __set
/**
* 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 __set($name, $value)
{
try {
return parent::__set($name, $value);
} catch (CException $e) {
$setter = 'set' . $name;
if (method_exists($this->message, $setter)) {
$this->message->{$setter}($value);
} else {
throw $e;
}
}
}
示例2: __set
public function __set($name, $val)
{
try {
return parent::__set($name, $val);
} catch (CException $e) {
$method_name = Yii::app()->text->underscoreToCamelcase($name);
$method_name = 'set' . ucfirst($method_name);
if (method_exists($this, $method_name)) {
return $this->{$method_name}($val);
} else {
throw new CException($e->getMessage());
}
}
}
示例3: __set
public function __set($name, $value)
{
$setter = 'set' . $name;
if (false !== method_exists($this, $setter)) {
return call_user_func_array(array($this, $setter), array($value));
} else {
if (false !== property_exists($this, $name)) {
return $this->{$name} = $value;
} else {
if (false !== $this->getIsProxy() && false !== method_exists($this->_instance, $setter)) {
return call_user_func_array(array($this->_instance, $setter), array($value));
} else {
if (false !== $this->getIsProxy() && false !== property_exists($this->_instance, $name)) {
return $this->_instance->{$name} = $value;
}
}
}
}
return parent::__set($name, $value);
}
示例4: __set
public function __set($strName, $mixValue)
{
switch ($strName) {
case 'objCart':
$this->objCart = $mixValue;
return;
case 'CheckoutForm':
$this->CheckoutForm = $mixValue;
return;
default:
return parent::__set($strName, $mixValue);
}
}