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


PHP modObjectCreateProcessor::afterSave方法代碼示例

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


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

示例1: afterSave

 public function afterSave()
 {
     $categories = $this->getCategories();
     $categories = $this->object->setCategories($categories);
     $this->object->set('categories', $categories);
     return parent::afterSave();
 }
開發者ID:Vitaliz,項目名稱:miniShop2,代碼行數:7,代碼來源:create.class.php

示例2: afterSave

 public function afterSave()
 {
     $contexts = $this->getProperty('access_contexts', '');
     $contexts = is_array($contexts) ? $contexts : explode(',', $contexts);
     $contexts = array_unique($contexts);
     if (!empty($contexts)) {
         $flush = false;
         if ($this->getProperty('access_admin')) {
             if ($this->addAdminAccess($contexts)) {
                 $flush = true;
             }
         }
         if ($this->getProperty('access_anon')) {
             if ($this->addAnonymousAccess($contexts)) {
                 $flush = true;
             }
         }
         if ($this->getProperty('access_parallel')) {
             if ($this->addParallelUserGroup($contexts)) {
                 $flush = true;
             }
         }
         $userGroups = $this->getProperty('access_usergroups');
         if (!empty($userGroups)) {
             $userGroups = is_array($userGroups) ? $userGroups : explode(',', $userGroups);
             if ($this->addOtherUserGroups($userGroups, $contexts)) {
                 $flush = true;
             }
         }
         if ($flush) {
             $this->flushPermissions();
         }
     }
     return parent::afterSave();
 }
開發者ID:ChrstnMgcn,項目名稱:revolution,代碼行數:35,代碼來源:create.class.php

示例3: afterSave

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

示例4: afterSave

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

示例5: afterSave

 public function afterSave()
 {
     $widgets = $this->getProperty('widgets', null);
     if ($widgets != null) {
         $this->assignWidgets($widgets);
     }
     return parent::afterSave();
 }
開發者ID:ChrstnMgcn,項目名稱:revolution,代碼行數:8,代碼來源:create.class.php

示例6: afterSave

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

示例7: afterSave

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

示例8: afterSave

 /** {@inheritDoc} */
 public function afterSave()
 {
     $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,代碼行數:14,代碼來源:create.class.php

示例9: afterSave

 /** {@inheritDoc} */
 public function afterSave()
 {
     $delivery_id = $this->object->get('id');
     /* @var msDeliveryMember $entry */
     $payments = $this->getProperty('payments');
     if (!empty($payments) && is_array($payments)) {
         foreach ($payments as $payment => $v) {
             if ($v == 1) {
                 $entry = $this->modx->newObject('msDeliveryMember');
                 $entry->fromArray(array('delivery_id' => $delivery_id, 'payment_id' => $payment), '', true);
                 $entry->save();
             }
         }
     }
     return parent::afterSave();
 }
開發者ID:volkovnd,項目名稱:miniShop2,代碼行數:17,代碼來源:create.class.php

示例10: afterSave

 public function afterSave()
 {
     $urlHistory = new UrlHistory($this->modx);
     $short = $urlHistory->encodeId($this->object->id);
     while ($this->modx->getObject('modResource', array('alias' => $short))) {
         $newObject = $this->modx->newObject('UrlHistoryItem');
         $newObject->set('url', $this->object->url);
         $newObject->save();
         $short = $urlHistory->encodeId($newObject->id, true);
         $newObject->set('short', $short);
         $newObject->save();
         $this->object->remove();
         $this->object = $newObject;
     }
     $siteUrl = $this->modx->getOption('site_url');
     $this->object->set('short', $siteUrl . $short);
     $this->object->save();
     return parent::afterSave();
 }
開發者ID:jiripavlicek,項目名稱:UrlHistory,代碼行數:19,代碼來源:create.class.php

示例11: afterSave

 public function afterSave()
 {
     $this->setContexts();
     if ($this->modx->hasPermission('usergroup_user_edit')) {
         $this->setResourceGroups();
     }
     /* access wizard stuff */
     $flush = false;
     $users = $this->getProperty('aw_users', '');
     if (!empty($users)) {
         $this->addUsersViaWizard($users);
     }
     $contexts = $this->getProperty('aw_contexts', '');
     if (!empty($contexts)) {
         $contexts = is_array($contexts) ? $contexts : explode(',', $contexts);
         $contexts = array_unique($contexts);
         $adminPolicy = trim($this->getProperty('aw_manager_policy', 0));
         if (!empty($adminPolicy)) {
             $this->addManagerContextAccessViaWizard($adminPolicy);
         }
         $policy = trim($this->getProperty('aw_contexts_policy', 0));
         if ($this->addContextAccessViaWizard($contexts, $policy)) {
             $flush = true;
         }
         $resourceGroups = $this->getProperty('aw_resource_groups', '');
         if (!empty($resourceGroups)) {
             $this->addResourceGroupsViaWizard($resourceGroups, $contexts);
         }
         $categories = $this->getProperty('aw_categories', '');
         if (!empty($categories)) {
             $this->addElementCategoriesViaWizard($categories, $contexts);
         }
         $parallel = $this->getProperty('aw_parallel', false);
         if ($parallel) {
             $this->addParallelResourceGroup($contexts);
         }
     }
     if ($flush) {
         $this->flushPermissions();
     }
     return parent::afterSave();
 }
開發者ID:rossng,項目名稱:revolution,代碼行數:42,代碼來源:create.class.php

示例12: afterSave

 /**
  * @return bool
  */
 public function afterSave()
 {
     $assetsPath = $this->modx->getOption('msgiftsrusynch_assets_path', null, $this->modx->getOption('assets_path') . 'components/msgiftsrusynch/');
     $path = $assetsPath . 'xml_files/' . $this->object->get('id') . '/';
     mkdir($path);
     for ($i = 0; $i < count($this->xmlFiles); $i++) {
         $ch = curl_init($this->url_gifts_api . $this->xmlFiles[$i]);
         $fp = fopen($path . $this->xmlFiles[$i], 'w+b');
         curl_setopt($ch, CURLOPT_FILE, $fp);
         curl_setopt($ch, CURLOPT_HEADER, 0);
         curl_exec($ch);
         curl_close($ch);
         fclose($fp);
         /*$this->object->set('description',
         			$path . $this->xmlFiles[$i] .' '.
         			$this->url_gifts_api . $this->xmlFiles[$i] .', '.
         			$this->object->get('description')
         		);
         		$this->object->save();*/
     }
     return parent::afterSave();
 }
開發者ID:bendasvadim,項目名稱:msGiftsRuSynch,代碼行數:25,代碼來源:create.class.php

示例13: afterSave

 /**
  * Ensure that Admin UserGroup always has access to this context, if not adding Admin ACL
  * @return bool
  */
 public function afterSave()
 {
     $adminGroup = $this->modx->getObject('modUserGroup', array('name' => 'Administrator'));
     if ($adminGroup && $this->object->get('principal') !== $adminGroup->get('id')) {
         $adminContextPolicy = $this->modx->getObject('modAccessPolicy', array('name' => 'Context'));
         if ($adminContextPolicy) {
             $adminContextAccess = $this->modx->getObject($this->classKey, array('principal' => $adminGroup->get('id'), 'principal_class' => 'modUserGroup', 'target' => $this->object->get('target')));
             if (!$adminContextAccess) {
                 $adminContextAccess = $this->modx->newObject('modAccessContext');
                 $adminContextAccess->set('principal', $adminGroup->get('id'));
                 $adminContextAccess->set('principal_class', 'modUserGroup');
                 $adminContextAccess->set('target', $this->object->get('target'));
                 $adminContextAccess->set('policy', $adminContextPolicy->get('id'));
                 $adminContextAccess->save();
             }
         }
     }
     if ($this->modx->getUser()) {
         $this->modx->user->getAttributes(array(), '', true);
     }
     return parent::afterSave();
 }
開發者ID:ChrstnMgcn,項目名稱:revolution,代碼行數:26,代碼來源:create.class.php

示例14: afterSave

 public function afterSave()
 {
     $_SESSION['comment_time'] = time();
     /**
      * Refresh comment and conversation cache
      */
     if ($this->modx->modxtalks->mtCache === true) {
         if (!$this->modx->modxtalks->cacheComment($this->object)) {
             $this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks web/comment/create] Error cache the comment with ID ' . $this->object->id);
         }
         if (!$this->modx->modxtalks->cacheConversation($this->theme)) {
             $this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks web/comment/create] Error cache the conversation with ID ' . $this->theme->id);
         }
     }
     /**
      * Send Notify to conversation moderators
      */
     $success = false;
     if (!$this->modx->modxtalks->isDisabledFunction('exec') && $this->modx->modxtalks->sendMail($this->object->id)) {
         $success = true;
     } elseif ($this->modx->modxtalks->notifyModerators($this->object)) {
         $success = true;
     }
     if (!$success) {
         $this->failure($this->modx->lexicon('modxtalks.error_try_again'));
         return false;
     }
     return parent::afterSave();
 }
開發者ID:jolichter,項目名稱:modxTalks,代碼行數:29,代碼來源:create.class.php

示例15: afterSave

 public function afterSave()
 {
     $this->modx->cacheManager->refresh(array('default' => array('qsb' => array())));
     return parent::afterSave();
 }
開發者ID:Realetive,項目名稱:QuickstartButtons,代碼行數:5,代碼來源:create.class.php


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