当前位置: 首页>>代码示例>>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;未经允许,请勿转载。