예제 #1
0
파일: Item.php 프로젝트: youprofit/Zurmo
 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;
     }
 }
예제 #2
0
 /**
  * @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);
     }
 }
예제 #3
0
 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;
     }
 }
예제 #5
0
 public function setLatestActivityDateTime($dateTime)
 {
     assert('is_string($dateTime)');
     AuditUtil::saveOriginalAttributeValue($this, 'latestActivityDateTime', $dateTime);
     $this->unrestrictedSet('latestActivityDateTime', $dateTime);
 }