Can a virtual attribute represent a model ? I've read this wiki but don't find answer.
Edit : The aim is to make my model more explicit for the user.
abstract class BaseDonnee{
protected $info;
public function representingColumn(){
return 'info'; //Please, I'm not sure this is right
}
public function setInfo(){
//I can set the attribute's value
$this->info = Info::model()->find('a condition')->info;
}
public function getInfo(){
return $this->info;
}
}
Edit 2 : When running the code, I can get an exception :
CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Nom de colonne non valide : 'info'..
How can I proceed to it work ?