In chapter 7,page 165,Changing the authenticate implementation,
the given code extracts username & password from a table User.
$user=User::model()->findByAttributes(array('username'=>$this->username));
but in my app,i have my users in two tables,called lawyer & client.
So i have username,password attributes in both tables.
I want to use both of these tables to be searched,when a user is trying to login.
I tried to do it like this.but it doesn’t work.
$user=(Lawyer::model()->findByAttributes(array('userName'=>$this->username)))|| $user=(Client::model()->findByAttributes(array('userName'=>$this->username))) ;
this is what i get when tried with above code snippet.
PHP Error : Trying to get property of non-object.
Any help please,