当前位置: 首页>>代码示例>>PHP>>正文


PHP modResource::removeLock方法代码示例

本文整理汇总了PHP中modResource::removeLock方法的典型用法代码示例。如果您正苦于以下问题:PHP modResource::removeLock方法的具体用法?PHP modResource::removeLock怎么用?PHP modResource::removeLock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在modResource的用法示例。


在下文中一共展示了modResource::removeLock方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: process

 public function process()
 {
     if (!$this->addLock()) {
         return $this->failure($this->modx->lexicon('resource_locked_by', array('id' => $this->resource->get('id'), 'user' => $this->lockedUser->get('username'))));
     }
     if ($this->isSiteStart()) {
         return $this->failure($this->modx->lexicon('resource_err_unpublish_sitestart'));
     }
     $this->resource->set('published', false);
     $this->resource->set('pub_date', false);
     $this->resource->set('unpub_date', false);
     $this->resource->set('editedby', $this->modx->user->get('id'));
     $this->resource->set('editedon', time(), 'integer');
     $this->resource->set('publishedby', false);
     $this->resource->set('publishedon', false);
     if ($this->resource->save() == false) {
         $this->resource->removeLock();
         return $this->failure($this->modx->lexicon('resource_err_unpublish'));
     }
     $this->fireAfterUnPublishEvent();
     $this->logManagerAction();
     $skipClearCache = $this->getProperty('skipClearCache', false);
     if ($skipClearCache == false) {
         $this->clearCache();
     }
     return $this->success('', $this->resource->get(array('id')));
 }
开发者ID:lokamaya,项目名称:Collections,代码行数:27,代码来源:unpublish.class.php

示例2: process

 public function process()
 {
     if (!$this->addLock()) {
         return $this->failure($this->modx->lexicon('resource_locked_by', array('id' => $this->resource->get('id'), 'user' => $this->lockedUser->get('username'))));
     }
     $duplicateAlias = $this->checkForDuplicateAlias();
     if ($duplicateAlias !== false) {
         return $this->failure($duplicateAlias);
     }
     /* publish resource */
     $this->resource->set('published', true);
     $this->resource->set('pub_date', false);
     $this->resource->set('unpub_date', false);
     $this->resource->set('editedby', $this->modx->user->get('id'));
     $this->resource->set('editedon', time(), 'integer');
     $this->resource->set('publishedby', $this->modx->user->get('id'));
     $this->resource->set('publishedon', time());
     $saved = $this->resource->save();
     $this->resource->removeLock();
     if (!$saved) {
         return $this->failure($this->modx->lexicon('resource_err_publish'));
     }
     $this->fireAfterPublish();
     $this->logManagerAction();
     $this->clearCache();
     return $this->success('', $this->resource->get(array('id', 'pub_date', 'unpub_date', 'editedby', 'editedon', 'publishedby', 'publishedon')));
 }
开发者ID:ChrstnMgcn,项目名称:revolution,代码行数:27,代码来源:publish.class.php

示例3: cleanup

 /**
  * Cleanup the processor and return the resulting object
  *
  * @return array
  */
 public function cleanup()
 {
     $this->object->removeLock();
     $this->clearCache();
     $returnArray = $this->object->get(array_diff(array_keys($this->object->_fields), array('content', 'ta', 'introtext', 'description', 'link_attributes', 'pagetitle', 'longtitle', 'menutitle', 'properties')));
     foreach ($returnArray as $k => $v) {
         if (strpos($k, 'tv') === 0) {
             unset($returnArray[$k]);
         }
     }
     $returnArray['class_key'] = $this->object->get('class_key');
     $this->workingContext->prepare(true);
     $returnArray['preview_url'] = $this->modx->makeUrl($this->object->get('id'), $this->object->get('context_key'), '', 'full');
     return $this->success('', $returnArray);
 }
开发者ID:semencov-com,项目名称:affiliate,代码行数:20,代码来源:update.class.php

示例4: deleteChildren

 /**
  * Delete all children of this resource
  * @return array
  */
 public function deleteChildren()
 {
     if (count($this->children) > 0) {
         /** @var modResource $child */
         foreach ($this->children as $child) {
             $locked = $child->addLock();
             if ($locked !== true) {
                 /** @var modUser $user */
                 $user = $this->modx->getObject('modUser', $locked);
                 if ($user) {
                     $this->modx->log(modX::LOG_LEVEL_ERROR, $this->modx->lexicon('resource_locked_by', array('id' => $child->get('id'), 'user' => $user->get('username'))));
                 }
             }
             $child->set('deleted', true);
             $child->set('deletedby', $this->modx->user->get('id'));
             $child->set('deletedon', $this->deletedTime);
             if ($child->save() == false) {
                 $child->removeLock();
                 $this->resource->removeLock();
             }
         }
     }
     return $this->children;
 }
开发者ID:e-gob,项目名称:apps.gob.cl,代码行数:28,代码来源:delete.class.php

示例5: cleanup

 /**
  * {@inheritDoc}
  * @return mixed
  */
 public function cleanup()
 {
     $this->object->removeLock();
     $this->clearCache();
     return $this->success('', array('id' => $this->object->get('id')));
 }
开发者ID:e-gob,项目名称:apps.gob.cl,代码行数:10,代码来源:create.class.php

示例6: removeLock

 /**
  * Remove the lock from the Resource
  * @return boolean
  */
 public function removeLock()
 {
     return $this->resource->removeLock();
 }
开发者ID:lokamaya,项目名称:Collections,代码行数:8,代码来源:undelete.class.php


注:本文中的modResource::removeLock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。