/** * * Magic setter for record properties; automatically calls __setColName() * methods when they exist. * * @param string $key The property name. * * @param mixed $val The value to set. * * @return void * */ public function __set($key, $val) { // if an accessor method exists, use it if (!empty($this->_access_methods[$key]['set'])) { // use accessor method $method = $this->_access_methods[$key]['set']; $this->{$method}($val); $this->_setIsDirty(); } else { // no accessor method; use parent method parent::__set($key, $val); } }