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


PHP modResource::remove方法代码示例

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


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

示例1: process

 /**
  * {@inheritDoc}
  * @return mixed
  */
 public function process()
 {
     if (!$this->resource->checkPolicy('delete')) {
         return $this->failure($this->modx->lexicon('resource_err_delete'));
     }
     $resources = array($this->resource);
     $ids = array($this->resource->id);
     $this->modx->invokeEvent('OnBeforeEmptyTrash', array('ids' => &$ids, 'resources' => &$resources));
     $this->handleChildren();
     /** @var modResourceGroupResource[] $resourceGroupResources */
     $resourceGroupResources = $this->resource->getMany('ResourceGroupResources');
     /** @var modTemplateVarResource[] $templateVarResources */
     $templateVarResources = $this->resource->getMany('TemplateVarResources');
     foreach ($resourceGroupResources as $resourceGroupResource) {
         $resourceGroupResource->remove();
     }
     foreach ($templateVarResources as $templateVarResource) {
         $templateVarResource->remove();
     }
     $this->modx->removeCollection('CollectionSelection', array('resource' => $this->resource->id));
     if ($this->resource->remove() == false) {
         return $this->failure($this->modx->lexicon('resource_err_delete'));
     }
     $this->modx->invokeEvent('OnEmptyTrash', array('num_deleted' => 1, 'resources' => &$resources, 'ids' => &$ids));
     $this->logManagerAction();
     $skipClearCache = $this->getProperty('skipClearCache', false);
     if ($skipClearCache == false) {
         $this->clearCache();
     }
     return $this->success();
 }
开发者ID:lokamaya,项目名称:Collections,代码行数:35,代码来源:remove.class.php

示例2: remove

 /**
  * @param array $ancestors
  *
  * @return bool
  */
 public function remove(array $ancestors = array())
 {
     $collection = $this->xpdo->getIterator('TicketThread', array('name' => 'resource-' . $this->id));
     /** @var TicketThread $item */
     foreach ($collection as $item) {
         $item->remove();
     }
     /** @var TicketAuthor $profile */
     if ($profile = $this->xpdo->getObject('TicketAuthor', $this->get('createdby'))) {
         $profile->removeAction('ticket', $this->id, $this->get('createdby'));
     }
     return parent::remove($ancestors);
 }
开发者ID:soulcreate,项目名称:Tickets,代码行数:18,代码来源:ticket.class.php

示例3: tearDown

 public function tearDown()
 {
     parent::tearDown();
     $this->thread->remove();
     $this->resource->remove();
 }
开发者ID:raadhuis,项目名称:modx-basic,代码行数:6,代码来源:QuipTest.php

示例4: remove

 /**
  * Override remove to remove the associated Quip thread
  *
  * {@inheritDoc}
  *
  * @param array $ancestors
  * @return boolean
  */
 public function remove(array $ancestors = array())
 {
     $removed = parent::remove($ancestors);
     if ($removed) {
         $quipPath = $this->xpdo->getOption('quip.core_path', null, $this->xpdo->getOption('core_path') . 'components/quip/');
         $this->xpdo->addPackage('quip', $quipPath . 'model/');
         /** @var quipThread $thread */
         $thread = $this->xpdo->getObject('quipThread', array('name' => 'article-b' . $this->get('parent') . '-' . $this->get('id')));
         if ($thread) {
             $thread->remove();
         }
     }
     return $removed;
 }
开发者ID:raadhuis,项目名称:modx-basic,代码行数:22,代码来源:article.class.php


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