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


PHP AbstractAdapter::removeItem方法代碼示例

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


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

示例1: manageAction

 /**
  * All a user to add and update a feed in the application
  *
  * @return ViewModel
  */
 public function manageAction()
 {
     $formManager = $this->serviceLocator->get('FormElementManager');
     $form = $formManager->get('BabyMonitor\\Forms\\ManageRecordForm');
     $feedId = (int) $this->params()->fromRoute('id');
     if ($this->getRequest()->isGet()) {
         if (!empty($feedId)) {
             if ($feed = $this->_feedTable->fetchById($feedId)) {
                 $form->setData($feed->getArrayCopy());
             } else {
                 $this->flashMessenger()->addInfoMessage('Unable to find that feed. Perhaps a new one?');
                 return $this->redirect()->toRoute(self::DEFAULT_ROUTE, array('action' => 'manage'));
             }
         }
     }
     if ($this->getRequest()->isPost()) {
         $form->setData($this->getRequest()->getPost());
         if ($form->isValid()) {
             $feed = new FeedModel();
             $feed->exchangeArray($form->getData());
             $this->_feedTable->save($feed);
             if (!is_null($this->_cache)) {
                 $this->_cache->removeItem(self::KEY_ALL_RESULTS);
             }
             $this->getEventManager()->trigger('Feed.Modify', $this, array('feedData' => $feed));
             return $this->redirect()->toRoute(self::DEFAULT_ROUTE, array());
         }
     }
     return new ViewModel(array('form' => $form, 'cancelTitle' => $feedId ? "Don't update the record" : "Don't create the record", 'messages' => array('info' => $this->flashMessenger()->hasInfoMessages())));
 }
開發者ID:rawatanil3,項目名稱:zf2forbeginners-old,代碼行數:35,代碼來源:FeedsController.php

示例2: removeItem

 /**
  * Remove an item.
  *
  * @param  string $cacheId
  *
  * @return bool
  */
 public function removeItem($cacheId)
 {
     $cacheId = $this->normalizeKey($cacheId);
     try {
         return $this->cache->removeItem($cacheId);
     } catch (ZendException\ExceptionInterface $ex) {
         return false;
     }
 }
開發者ID:gunnilx,項目名稱:WurflCache,代碼行數:16,代碼來源:ZendCacheConnector.php

示例3: clearItem

 /**
  * Remove an item from the cache
  * @param string $key
  * @return boolean
  */
 public function clearItem($key)
 {
     //check if caching is enabled
     $arr_config = $this->getServiceLocator()->get("config");
     if ($arr_config["front_end_application_config"]["cache_enabled"] == FALSE) {
         return FALSE;
     }
     //end if
     //adjust key
     $key = $this->setIdentifier($key);
     $this->storageFactory->removeItem($key);
 }
開發者ID:BanterMediaSA,項目名稱:majestic3-open-source,代碼行數:17,代碼來源:FrontCachesAbstract.php

示例4: removeItem

 /**
  * Remove an item.
  *
  * @param  string $key
  * @return bool
  * @throws Exception\ExceptionInterface
  *
  * @triggers removeItem.pre(PreEvent)
  * @triggers removeItem.post(PostEvent)
  * @triggers removeItem.exception(ExceptionEvent)
  */
 public function removeItem($key)
 {
     $options = $this->getOptions();
     if ($options->getWritable() && $options->getClearStatCache()) {
         clearstatcache();
     }
     return parent::removeItem($key);
 }
開發者ID:tillk,項目名稱:vufind,代碼行數:19,代碼來源:Filesystem.php

示例5: removeItem

 /**
  * Remove an item.
  *
  * Options:
  *  - namespace <string> optional
  *    - The namespace to use (Default: namespace of object)
  *  - ignore_missing_items <boolean> optional
  *    - Throw exception on missing item
  *
  * @param  string $key
  * @param  array  $options
  * @return boolean
  * @throws Exception\ExceptionInterface
  *
  * @triggers removeItem.pre(PreEvent)
  * @triggers removeItem.post(PostEvent)
  * @triggers removeItem.exception(ExceptionEvent)
  */
 public function removeItem($key, array $options = array())
 {
     $baseOptions = $this->getOptions();
     if ($baseOptions->getWritable() && $baseOptions->getClearStatCache()) {
         clearstatcache();
     }
     return parent::removeItem($key, $options);
 }
開發者ID:brikou,項目名稱:zend_cache,代碼行數:26,代碼來源:Filesystem.php


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