當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。