public function __set($attributeName, $value) { $this->isSetting = true; try { if (!$this->isSaving && $this->isAudited) { AuditUtil::saveOriginalAttributeValue($this, $attributeName, $value); } parent::__set($attributeName, $value); $this->isSetting = false; } catch (Exception $e) { $this->isSetting = false; throw $e; } }
/** * @param RedBean_OODBBean $bean * @param bool $setDefaults * @throws NoCurrentUserSecurityException */ protected function constructDerived($bean, $setDefaults) { assert('$bean === null || $bean instanceof RedBean_OODBBean'); assert('is_bool($setDefaults)'); parent::constructDerived($bean, $setDefaults); // Even though setting the requestedByUser is not technically // a default in the sense of a Yii default rule, // if true the requestedByUser is not set because blank models // are used for searching mass updating. if ($bean === null && $setDefaults) { $currentUser = Yii::app()->user->userModel; if (!$currentUser instanceof User) { throw new NoCurrentUserSecurityException(); } AuditUtil::saveOriginalAttributeValue($this, 'requestedByUser', $currentUser); $this->unrestrictedSet('requestedByUser', $currentUser); } }
public function __set($attributeName, $value) { AuditUtil::saveOriginalAttributeValue($this, $attributeName, $value); parent::__set($attributeName, $value); }
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 setLatestActivityDateTime($dateTime) { assert('is_string($dateTime)'); AuditUtil::saveOriginalAttributeValue($this, 'latestActivityDateTime', $dateTime); $this->unrestrictedSet('latestActivityDateTime', $dateTime); }