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