I have configured my app to use my own WebUser component like this:
'components'=>array(
'user'=>array(
'class'=>'application.components.WebUser',
),
...
My WebUser component looks like this:
class WebUser extends RWebUser { // RWebUser extends CWebUser
public function prefix() {
...
}
}
And when I call the prefix function like this:
$this->tablePrefix = Yii::app()->user->prefix();
I get an error with this stacktrace:
#0 yiiframework/web/auth/CWebUser.php(108): CComponent->__get('')
#1 public_html/oms/protected/components/WebUser.php(<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/cool.gif' class='bbc_emoticon' alt='8)' />: CWebUser->__get('')
#2 public_html/oms/protected/components/DbConnection.php(11): WebUser->prefix()
#3 yiiframework/YiiBase.php(211): DbConnection->__construct()
So instead of WebUser->prefix() the magic get function is called without an argument. Why??
UPDATE:
I found the bug. In the prefix function I called $this->$property.