本文整理汇总了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;
}
示例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);
}
示例3: deleteItems
/**
* {@inheritdoc}
*/
public function deleteItems(array $keys)
{
foreach ($keys as $key) {
if (true === $this->provider->contains($key)) {
$this->provider->delete($key);
}
}
return $this;
}
示例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;
}
示例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);
}
}
示例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);
}
示例7: clearCache
/**
* @param string $key
* @return bool
*/
private function clearCache($key)
{
if (null === $this->cache) {
return true;
}
return $this->cache->delete($key);
}
示例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;
}
示例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());
}
示例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;
}
示例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();
}
}
}
示例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;
}
示例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();
}
}
示例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);
}
示例15: delete
public function delete($id)
{
return $this->_cacheImplement->delete($id);
}