當前位置: 首頁>>代碼示例>>PHP>>正文


PHP modObjectUpdateProcessor::afterSave方法代碼示例

本文整理匯總了PHP中modObjectUpdateProcessor::afterSave方法的典型用法代碼示例。如果您正苦於以下問題:PHP modObjectUpdateProcessor::afterSave方法的具體用法?PHP modObjectUpdateProcessor::afterSave怎麽用?PHP modObjectUpdateProcessor::afterSave使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在modObjectUpdateProcessor的用法示例。


在下文中一共展示了modObjectUpdateProcessor::afterSave方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: afterSave

 /** {@inheritDoc} */
 public function afterSave()
 {
     /*
     $this->thread->fromArray(array(
         'comment_last' => $this->object->get('id'),
         'comment_time' => $this->object->get('createdon'),
     ));
     $this->thread->save();
     */
     $this->thread->updateLastMessage();
     /* @var ecMessage $m */
     if ($m = $this->modx->getObject('ecMessage', $this->getProperty('id'))) {
         if ($m->notifyUser()) {
             $m->set('notify', 0);
             $m->set('notify_date', date('Y-m-d H:i:s'));
             $m->save();
         }
     }
     return parent::afterSave();
 }
開發者ID:KANU82,項目名稱:easyComm,代碼行數:21,代碼來源:update.class.php

示例2: afterSave

 public function afterSave()
 {
     /** @var xPDOFileCache $provider */
     $provider = $this->modx->cacheManager->getCacheProvider('oauth2server');
     $provider->flush();
     return parent::afterSave();
 }
開發者ID:lokamaya,項目名稱:oauth2-server,代碼行數:7,代碼來源:update.class.php

示例3: afterSave

 public function afterSave()
 {
     if ($this->modx->hasPermission('usergroup_user_edit')) {
         $this->addUsers();
     }
     return parent::afterSave();
 }
開發者ID:ChrstnMgcn,項目名稱:revolution,代碼行數:7,代碼來源:update.class.php

示例4: afterSave

 public function afterSave()
 {
     $this->updateTranslations($this->getProperties());
     $this->refreshURIs();
     $this->clearCache();
     return parent::afterSave();
 }
開發者ID:rosstimson,項目名稱:revolution,代碼行數:7,代碼來源:update.class.php

示例5: afterSave

 public function afterSave()
 {
     /* now store the permissions into the modAccessPermission table */
     /* and cache the data into the policy table */
     $permissions = $this->getProperty('permissions', null);
     if ($permissions !== null) {
         $permissions = is_array($permissions) ? $permissions : $this->modx->fromJSON($permissions);
         /* first erase all prior permissions */
         $oldPermissions = $this->object->getMany('Permissions');
         /** @var modAccessPermission $permission */
         foreach ($oldPermissions as $permission) {
             $permission->remove();
         }
         $added = array();
         foreach ($permissions as $permissionArray) {
             if (in_array($permissionArray['name'], $added)) {
                 continue;
             }
             $permission = $this->modx->newObject('modAccessPermission');
             $permission->set('template', $this->object->get('id'));
             $permission->set('name', $permissionArray['name']);
             $permission->set('description', $permissionArray['description']);
             $permission->set('value', true);
             $permission->save();
             $added[] = $permissionArray['name'];
         }
     }
     return parent::afterSave();
 }
開發者ID:ChrstnMgcn,項目名稱:revolution,代碼行數:29,代碼來源:update.class.php

示例6: afterSave

 /**
  * {@inheritDoc}
  *
  * @return mixed
  */
 public function afterSave()
 {
     if ($this->refreshURIs) {
         $this->modx->call('modResource', 'refreshURIs', array(&$this->modx));
     }
     return parent::afterSave();
 }
開發者ID:raadhuis,項目名稱:modx-basic,代碼行數:12,代碼來源:update.class.php

示例7: afterSave

 public function afterSave()
 {
     $this->saveRequired();
     if ($this->validationType) {
         $this->saveValidation();
     }
     return parent::afterSave();
 }
開發者ID:Jako,項目名稱:formz,代碼行數:8,代碼來源:update.class.php

示例8: afterSave

 public function afterSave()
 {
     $this->clearOldRules();
     $this->setFieldRules();
     $this->setTabRules();
     $this->setTVRules();
     $this->saveNewRules();
     return parent::afterSave();
 }
開發者ID:ChrstnMgcn,項目名稱:revolution,代碼行數:9,代碼來源:update.class.php

示例9: afterSave

 /**
  * After save
  * Add comment to cache
  *
  * @return void
  */
 public function afterSave()
 {
     if ($this->modx->modxtalks->mtCache === true) {
         if (!$this->modx->modxtalks->cacheComment($this->object)) {
             $this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks web/comment/vote] Cache comment error, ID ' . $this->object->id);
         }
     }
     return parent::afterSave();
 }
開發者ID:jolichter,項目名稱:modxTalks,代碼行數:15,代碼來源:vote.class.php

示例10: afterSave

 /** {@inheritDoc} */
 public function afterSave()
 {
     if ($event = $this->modx->getObject('vpEvent', $this->object->get('event'))) {
         $eventName = $event->get('name');
         /* set event */
         $this->modx->virtualpage->doEvent('create', $eventName, 'vpEvent', 10);
     }
     return parent::afterSave();
 }
開發者ID:sfgoo,項目名稱:virtualpage,代碼行數:10,代碼來源:update.class.php

示例11: afterSave

 public function afterSave()
 {
     /* now store the permissions into the modAccessPermission table */
     /* and cache the data into the policy table */
     $permissions = $this->getProperty('permissions', null);
     if ($permissions !== null) {
         $new_permissions_list = array();
         if (!is_array($permissions)) {
             $permissions = $this->modx->fromJSON($permissions);
             foreach ($permissions as $permission_item) {
                 $new_permissions_list[] = $permission_item['name'];
             }
         } else {
             $new_permissions_list = $permissions;
         }
         $deleted = array();
         /* first erase all prior permissions */
         $oldPermissions = $this->object->getMany('Permissions');
         /** @var modAccessPermission $permission */
         foreach ($oldPermissions as $permission) {
             if (!in_array($permission->get('name'), $new_permissions_list)) {
                 $deleted[] = $permission->get('name');
             }
             $permission->remove();
         }
         $added = array();
         foreach ($permissions as $permissionArray) {
             if (in_array($permissionArray['name'], $added)) {
                 continue;
             }
             $permission = $this->modx->newObject('modAccessPermission');
             $permission->set('template', $this->object->get('id'));
             $permission->set('name', $permissionArray['name']);
             $permission->set('description', $permissionArray['description']);
             $permission->set('value', true);
             $permission->save();
             $added[] = $permissionArray['name'];
         }
         // update all existing policies if needed
         if (!empty($deleted)) {
             $policies = $this->object->getMany('Policies');
             /** @var modAccessPolicy $policy */
             foreach ($policies as $policy) {
                 $policy_data = $policy->get('data');
                 foreach ($deleted as $deleted_perm) {
                     if (isset($policy_data[$deleted_perm])) {
                         unset($policy_data[$deleted_perm]);
                     }
                 }
                 $policy->set('data', $policy_data);
                 $policy->save();
             }
         }
     }
     return parent::afterSave();
 }
開發者ID:modxcustomize,項目名稱:Clickatell,代碼行數:56,代碼來源:update.class.php

示例12: afterSave

 /**
  * @return bool
  */
 public function afterSave()
 {
     $new_thread = $this->object->get('thread');
     if ($this->old_thread != $new_thread) {
         $this->object->changeThread($this->old_thread, $new_thread);
     } else {
         $this->object->clearTicketCache();
     }
     return parent::afterSave();
 }
開發者ID:soulcreate,項目名稱:Tickets,代碼行數:13,代碼來源:update.class.php

示例13: afterSave

 public function afterSave()
 {
     $this->action = $this->object->getOne('Action');
     $this->clearOldRules();
     $this->setFieldRules();
     $this->setTabRules();
     $this->setTVRules();
     $this->saveNewRules();
     return parent::afterSave();
 }
開發者ID:rosstimson,項目名稱:revolution,代碼行數:10,代碼來源:update.class.php

示例14: afterSave

 /**
  * @return bool
  */
 public function afterSave()
 {
     $this->object->clearTicketCache();
     /* @var TicketThread $thread */
     if ($thread = $this->object->getOne('Thread')) {
         $thread->updateLastComment();
     }
     $this->modx->cacheManager->delete('tickets/latest.comments');
     $this->modx->cacheManager->delete('tickets/latest.tickets');
     return parent::afterSave();
 }
開發者ID:soulcreate,項目名稱:Tickets,代碼行數:14,代碼來源:undelete.class.php

示例15: afterSave

 public function afterSave()
 {
     /* выполняем уведомления */
     if ($this->object->get('status') != $this->status) {
         $this->MlmSystem->Tools->sendNotice($this->object);
     }
     /* генерируем пути */
     if ($this->object->get('parent') != $this->parent) {
         $this->MlmSystem->Paths->removePathItem($this->object->get('id'));
         $this->MlmSystem->Paths->GeneratePaths($this->object->get('id'));
     }
     return parent::afterSave();
 }
開發者ID:vgrish,項目名稱:mlmsystem,代碼行數:13,代碼來源:update.class.php


注:本文中的modObjectUpdateProcessor::afterSave方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。