protected function ownerChange($newOwnerValue) { $this->checkPermissionsHasAnyOf(Permission::CHANGE_OWNER); $this->isSetting = true; try { if (!$this->isSaving) { AuditUtil::saveOriginalAttributeValue($this, 'owner', $newOwnerValue); } parent::__set('owner', $newOwnerValue); $this->isSetting = false; } catch (Exception $e) { $this->isSetting = false; throw $e; } }
public function __set($attributeName, $value) { if ($attributeName == 'owner') { $this->onBeforeOwnerChange(new CEvent($this, array('newOwner' => $value))); $this->ownerChange($value); $this->onAfterOwnerChange(new CEvent($this, array('newOwner' => $value))); } else { parent::__set($attributeName, $value); } }