Reputation: 8384
My User
class is derived from CActiveRecord
. It has a field email
mapped to a database and there is an extension which needs the variable to be named mailaddress
.
How can I add a member variable named mailaddress
under User
class, so that it returns the value stored in email
?
Upvotes: 0
Views: 332
Reputation: 437336
Add a read-only component property to your User
class:
public function getMailAddress() {
return $this->email;
}
Upvotes: 1