This time - a simple problem:
public function beforeValidate();
When making use of one of these great before(…) or after(…) hooks in the CActiveRecord, how can I differentiate between the "old" data in the DB and the "new" data trying to overwrite the old?
I’m looking for sth like:
/**
* Raise event informWebmaster if a user changed his email - JUST AS EXAMPLE
*/
public function beforeValidate()
{
if ($this->OLD->email !== $this->email) {
$event = new CModelEvent($this);
$this->informWebmaster($event);
}
return parent::beforeValidate();
}