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


PHP CacheProvider::delete方法代码示例

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


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

示例1: clearCache

 /**
  * Clears the cache
  */
 public function clearCache()
 {
     if ($this->cache) {
         $this->cache->delete(self::CACHE_KEY);
     }
     $this->localCache = null;
 }
开发者ID:abdeldayem,项目名称:pim-community-dev,代码行数:10,代码来源:ActionMetadataProvider.php

示例2: delete

 /**
  * @param $nombre
  */
 public function delete($nombre)
 {
     $list = $this->get($this->list_name);
     if (($key = array_search($nombre, $list)) !== false) {
         unset($list[$key]);
         $this->setList($list);
     }
     $this->cache->delete($nombre);
 }
开发者ID:buuum,项目名称:cache,代码行数:12,代码来源:Cache.php

示例3: deleteItems

 /**
  * {@inheritdoc}
  */
 public function deleteItems(array $keys)
 {
     foreach ($keys as $key) {
         if (true === $this->provider->contains($key)) {
             $this->provider->delete($key);
         }
     }
     return $this;
 }
开发者ID:shieldo,项目名称:Cache,代码行数:12,代码来源:DoctrineCacheAdapter.php

示例4: get

 /**
  * {@inheritdoc}
  */
 public function get(RequesterInterface $requester, ResourceInterface $resource)
 {
     $cacheId = $this->getCacheId($requester, $resource);
     $permission = $this->cacheProvider->fetch($cacheId);
     if ($permission instanceof PermissionInterface) {
         return $permission;
     }
     $this->cacheProvider->delete($cacheId);
     return;
 }
开发者ID:alexdpy,项目名称:acl,代码行数:13,代码来源:PermissionBuffer.php

示例5: checkDeploy

 public function checkDeploy(GetResponseEvent $event)
 {
     if (null === $this->cache || $this->cache->contains(self::CHECK_DEPLOY_KEY)) {
         return;
     }
     $clients = $this->clientRepository->countClients();
     $cities = $this->cityRepository->countCities();
     $hasDefaultClient = $this->clientRepository->findOneByUid($this->defaultClientUid) instanceof Client;
     if ($clients <= 0 || $cities <= 0 || !$hasDefaultClient) {
         $this->cache->delete(self::CHECK_DEPLOY_KEY);
         throw new \RuntimeException('Make sure you did run the populate database command.');
     } else {
         $this->cache->save(self::CHECK_DEPLOY_KEY, true);
     }
 }
开发者ID:redelivre,项目名称:login-cidadao,代码行数:15,代码来源:CheckDeployEventSubscriber.php

示例6: evictFromCacheByKey

 /**
  * Removes an ACL from the cache
  *
  * @param string $key
  */
 private function evictFromCacheByKey($key)
 {
     if (!$this->cache->contains($key)) {
         return;
     }
     $this->cache->delete($key);
 }
开发者ID:Dren-x,项目名称:mobit,代码行数:12,代码来源:AclCache.php

示例7: clearCache

 /**
  * @param string $key
  * @return bool
  */
 private function clearCache($key)
 {
     if (null === $this->cache) {
         return true;
     }
     return $this->cache->delete($key);
 }
开发者ID:slavamuravey,项目名称:leaderboard-bundle,代码行数:11,代码来源:DataLoader.php

示例8: delete

 /**
  * Deletes an item in the cache based on the id
  *
  * @param string $id    the id of the cached data entry
  * @return bool         true if the item was deleted successfully
  */
 public function delete($id)
 {
     if ($this->enabled) {
         return $this->driver->delete($id);
     }
     return false;
 }
开发者ID:indigo423,项目名称:blog.no42.org,代码行数:13,代码来源:Cache.php

示例9: flushByName

 /**
  * @param $name
  */
 public function flushByName($name)
 {
     $keys = (array) $this->cache->fetch($name);
     foreach (array_keys($keys) as $key) {
         $this->cache->delete($key);
     }
     $this->cache->save($name, array());
 }
开发者ID:Focus-Flow,项目名称:silverstripe-cacheinclude,代码行数:11,代码来源:CacheInclude.php

示例10: deleteMulti

 /**
  * Removes multiple items from Cache.
  *
  * @param string[] $keys of items to be removed
  *
  * @return bool true on success.
  */
 public function deleteMulti(array $keys)
 {
     foreach ($keys as $key) {
         if (!$this->cache->delete($key)) {
             return false;
         }
     }
     return true;
 }
开发者ID:Covert-Inferno,项目名称:iveeCore,代码行数:16,代码来源:DoctrineCacheWrapper.php

示例11: clearCache

 /**
  * Clears the ownership metadata cache
  *
  * If the class name is not specified this method clears all cached data
  *
  * @param string|null $className
  */
 public function clearCache($className = null)
 {
     if ($this->cache) {
         if ($className !== null) {
             $this->cache->delete($className);
         } else {
             $this->cache->deleteAll();
         }
     }
 }
开发者ID:xamin123,项目名称:platform,代码行数:17,代码来源:OwnershipMetadataProvider.php

示例12: get

 /**
  * Fetches an entry from the cache.
  *
  * @param string $id           The id of the cache entry to fetch
  * @param mixed  $defaultValue The default value if $id not found
  * @param bool   $remove
  *
  * @return mixed The cached data or FALSE, if no cache entry exists for the given id.
  */
 public function get($id, $defaultValue = null, $remove = false)
 {
     if (false === ($_data = $this->_store->fetch($id))) {
         if (!$remove) {
             $this->_store->save($id, $_data = $defaultValue);
         }
     } elseif ($remove) {
         $this->_store->delete($id);
     }
     return $_data;
 }
开发者ID:kisma,项目名称:kisma,代码行数:20,代码来源:Flexistore.php

示例13: clearCache

 /**
  * Clears the cache by security type
  *
  * If the $securityType is not specified, clear all cached data
  *
  * @param string|null $securityType The security type.
  */
 public function clearCache($securityType = null)
 {
     if ($this->cache) {
         if ($securityType !== null) {
             $this->cache->delete($securityType);
         } else {
             $this->cache->deleteAll();
         }
     }
     if ($securityType !== null) {
         unset($this->localCache[$securityType]);
     } else {
         $this->localCache = array();
     }
 }
开发者ID:xamin123,项目名称:platform,代码行数:22,代码来源:EntitySecurityMetadataProvider.php

示例14: clearEnvironmentsCache

 /**
  * Clear the environments cache for a project.
  *
  * Use this after creating/deleting/updating environment(s).
  *
  * @param Project $project
  */
 protected function clearEnvironmentsCache(Project $project = null)
 {
     $project = $project ?: $this->getSelectedProject();
     self::$cache->delete('environments:' . $project->id);
 }
开发者ID:ratajczak,项目名称:platformsh-cli,代码行数:12,代码来源:PlatformCommand.php

示例15: delete

 public function delete($id)
 {
     return $this->_cacheImplement->delete($id);
 }
开发者ID:jay45,项目名称:porn,代码行数:4,代码来源:MyCache.php


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