Possible Duplicate:
Can't use method return value in write context
I sometimes encountered this error Can't use method return value in write context
. However, I don't know what does WRITE CONTEXT
means in this sentence. Could someone tell me a little general explaination of it.
Thank you.
The code for this error if you want to refer to is on line if(empty($this->loadUser()))
However just to clarify, I just want to find out the meaning of "write context":
public function verify()
{
if(empty($this->loadUser()))
$this->addError('username','Incorrect username.');
else
{
$user = $this->loadUser();
$project = $this->loadProject($pid);
$project->associateUserToProject($this->loadUser());
$project->associateUserToRole($this->role, $this->user->id)
}
}
public function loadUser() {
return User::model()->findByAttributes(array('username'=>$this->username));
}