当前位置: 首页>>代码示例>>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;未经允许,请勿转载。