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


PHP xPDOObject::remove方法代码示例

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


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

示例1: remove

 public function remove(array $ancestors = array())
 {
     $removed = parent::remove();
     if ($removed) {
         $this->clearCache();
     }
     return $removed;
 }
开发者ID:semencov-com,项目名称:affiliate,代码行数:8,代码来源:modsystemsetting.class.php

示例2: remove

 /**
  * @param array $ancestors
  *
  * @return bool
  */
 public function remove(array $ancestors = array())
 {
     /** @var TicketAuthor $profile */
     if ($profile = $this->xpdo->getObject('TicketAuthor', $this->get('uid'))) {
         $profile->removeAction('view', $this->get('parent'), $this->get('uid'));
     }
     return parent::remove($ancestors);
 }
开发者ID:soulcreate,项目名称:Tickets,代码行数:13,代码来源:ticketview.class.php

示例3: remove

 public function remove(array $ancestors = array())
 {
     $removed = parent::remove($ancestors);
     if ($removed && !$this->getOption(xPDO::OPT_SETUP)) {
         $this->xpdo->call('modNamespace', 'clearCache', array(&$this->xpdo));
     }
     return $removed;
 }
开发者ID:adamwintle,项目名称:flexibility5,代码行数:8,代码来源:modnamespace.class.php

示例4: remove

 /**
  * Overrides xPDOObject::remove to fire modX-specific events.
  *
  * {@inheritDoc}
  */
 public function remove(array $ancestors = array())
 {
     if ($this->xpdo instanceof modX) {
         $this->xpdo->invokeEvent('OnPluginEventBeforeRemove', array('pluginEvent' => &$this, 'ancestors' => $ancestors));
     }
     $removed = parent::remove($ancestors);
     if ($removed && $this->xpdo instanceof modX) {
         $this->xpdo->invokeEvent('OnPluginEventRemove', array('pluginEvent' => &$this, 'ancestors' => $ancestors));
     }
     return $removed;
 }
开发者ID:JoeBlow,项目名称:revolution,代码行数:16,代码来源:modpluginevent.class.php

示例5: remove

 /**
  * @param array $ancestors
  *
  * @return bool
  */
 public function remove(array $ancestors = array())
 {
     $type = '';
     $class = $this->get('class');
     if ($class == 'TicketComment') {
         $type = 'vote_comment';
     } elseif ($class == 'Ticket') {
         $type = 'vote_ticket';
     }
     if (!empty($type)) {
         /** @var TicketAuthor $profile */
         if ($profile = $this->xpdo->getObject('TicketAuthor', $this->get('owner'))) {
             $profile->removeAction($type, $this->id, $this->get('createdby'));
         }
     }
     return parent::remove($ancestors);
 }
开发者ID:soulcreate,项目名称:Tickets,代码行数:22,代码来源:ticketvote.class.php

示例6: remove

 /**
  * {@inheritdoc}
  * Delete option values for product in category while remove option from category
  */
 public function remove(array $ancestors = array())
 {
     $q = $this->xpdo->newQuery('msProduct', array('parent' => $this->get('category_id')));
     $q->select('id');
     if ($q->prepare() && $q->stmt->execute()) {
         $products = $q->stmt->fetchAll(PDO::FETCH_COLUMN);
         $products = implode(',', $products);
         $key = $this->getOne('Option')->get('key');
         $key = $this->xpdo->quote($key);
         if (count($products) > 0) {
             $sql = "DELETE FROM {$this->xpdo->getTableName('msProductOption')} WHERE `product_id` IN ({$products}) AND `key`={$key};";
             $stmt = $this->xpdo->prepare($sql);
             $stmt->execute();
             $stmt->closeCursor();
         }
     }
     return parent::remove($ancestors);
 }
开发者ID:rafull6,项目名称:texno-service,代码行数:22,代码来源:mscategoryoption.class.php

示例7: remove

 /**
  * Custom remove that respects access policies.
  *
  * {@inheritdoc}
  */
 public function remove(array $ancestors = array())
 {
     $removed = false;
     if (!$this->checkPolicy('remove')) {
         $this->xpdo->error->failure($this->xpdo->lexicon('permission_denied'));
     }
     $removed = parent::remove($ancestors);
     return $removed;
 }
开发者ID:JoeBlow,项目名称:revolution,代码行数:14,代码来源:modaccessibleobject.class.php

示例8: remove

 /**
  * Overrides xPDOObject::remove. Removes and uninstalls the package.
  *
  * {@inheritdoc}
  */
 public function remove($force = false, array $ancestors = array(), $uninstall = true)
 {
     $removed = false;
     if ($this->get('installed') == null || $this->get('installed') == '0000-00-00 00:00:00') {
         $uninstalled = true;
     } else {
         if ($uninstall) {
             $uninstalled = $this->uninstall();
         }
     }
     if ($uninstalled || $force) {
         $removed = parent::remove($ancestors);
     }
     return $removed;
 }
开发者ID:JoeBlow,项目名称:revolution,代码行数:20,代码来源:modtransportpackage.class.php

示例9: remove

 /** 
  * We override the parent func so we can clean out the asset files
  */
 public function remove(array $ancestors = array())
 {
     $storage_basedir = $this->xpdo->getOption('assets_path') . rtrim($this->xpdo->getOption('assman.library_path'), '/') . '/';
     $this->xpdo->log(\modX::LOG_LEVEL_DEBUG, 'Removing Asset ' . $this->getPrimaryKey() . ' with assets in storage_basedir ' . $storage_basedir, '', __CLASS__, __FILE__, __LINE__);
     $file = $this->get('path');
     if (file_exists($file)) {
         if (!unlink($file)) {
             $this->xpdo->log(\modX::LOG_LEVEL_ERROR, 'Failed to remove file asset for Asset ' . $this->getPrimaryKey() . ': ' . $file, '', __CLASS__, __FILE__, __LINE__);
             throw new \Exception('Failed to delete asset file.');
         }
     } else {
         $this->xpdo->log(\modX::LOG_LEVEL_INFO, 'File does not exist for Asset ' . $this->getPrimaryKey() . ': ' . $file . ' This could be because the file was manually deleted or because you did not pass the $storage_basedir parameter.', '', __CLASS__, __FILE__, __LINE__);
     }
     // remove thumbnails
     $storage_basedir = $this->xpdo->getOption('assets_path') . rtrim($this->xpdo->getOption('assman.library_path'), '/') . '/';
     $dir = $storage_basedir . 'resized/' . $this->get('asset_id') . '/';
     self::rrmdir($dir);
     return parent::remove($ancestors);
 }
开发者ID:crecorn,项目名称:assetmanager,代码行数:22,代码来源:asset.class.php


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