本文整理汇总了PHP中Doctrine\Common\Cache\CacheProvider::getNamespace方法的典型用法代码示例。如果您正苦于以下问题:PHP CacheProvider::getNamespace方法的具体用法?PHP CacheProvider::getNamespace怎么用?PHP CacheProvider::getNamespace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\Common\Cache\CacheProvider
的用法示例。
在下文中一共展示了CacheProvider::getNamespace方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*
* @param CacheProvider $cache
*/
public function __construct(CacheProvider $cache = null)
{
$this->cache = $cache;
if ($this->cache !== null && $this->cache->getNamespace() === '') {
$this->cache->setNamespace(self::CACHE_NAMESPACE);
}
}
示例2: __construct
/**
* @param ConfigProvider $securityConfigProvider
* @param ConfigProvider $entityConfigProvider
* @param CacheProvider|null $cache
*/
public function __construct(ConfigProvider $securityConfigProvider, ConfigProvider $entityConfigProvider, CacheProvider $cache = null)
{
$this->securityConfigProvider = $securityConfigProvider;
$this->entityConfigProvider = $entityConfigProvider;
$this->cache = $cache;
if ($this->cache !== null && $this->cache->getNamespace() === '') {
$this->cache->setNamespace(self::CACHE_NAMESPACE);
}
}
示例3: __construct
/**
* Constructor
*
* @param array $owningEntityNames
* @param ConfigProvider $configProvider
* @param EntityClassResolver $entityClassResolver
* @param CacheProvider|null $cache
*
* @SuppressWarnings(PHPMD.NPathComplexity)
*/
public function __construct(array $owningEntityNames, ConfigProvider $configProvider, EntityClassResolver $entityClassResolver = null, CacheProvider $cache = null)
{
$this->organizationClass = $entityClassResolver === null ? $owningEntityNames['organization'] : $entityClassResolver->getEntityClass($owningEntityNames['organization']);
$this->businessUnitClass = $entityClassResolver === null ? $owningEntityNames['business_unit'] : $entityClassResolver->getEntityClass($owningEntityNames['business_unit']);
$this->userClass = $entityClassResolver === null ? $owningEntityNames['user'] : $entityClassResolver->getEntityClass($owningEntityNames['user']);
$this->configProvider = $configProvider;
$this->cache = $cache;
if ($this->cache !== null && $this->cache->getNamespace() === '') {
$this->cache->setNamespace(self::CACHE_NAMESPACE);
}
$this->noOwnershipMetadata = new OwnershipMetadata();
}
示例4: clearCacheDriver
protected function clearCacheDriver(CacheProvider $cacheDriver = null, $description = "")
{
if ($cacheDriver !== null) {
$this->output .= 'Doctrine ' . $description . ' cache: ' . $cacheDriver->getNamespace() . ' — ';
$this->output .= $cacheDriver->deleteAll() ? '<info>OK</info>' : '<info>FAIL</info>';
$this->output .= PHP_EOL;
}
}
示例5: __construct
public function __construct(\Doctrine\Common\Cache\CacheProvider $engine, $ttl = 3600, $prefix = null)
{
$this->time = time();
$this->serializer = new \Zumba\Util\JsonSerializer();
$this->engine = $engine;
$this->default_ttl = $ttl;
if (!$prefix) {
$prefix = $engine->getNamespace();
}
$this->prefix = $prefix;
$this->auto_flush = true;
}
示例6: setCacheProvider
/**
* @param CacheProvider $cacheProvider
*/
public function setCacheProvider($cacheProvider)
{
$namespace = '[<>]' . rtrim($this->getName() . '|' . $cacheProvider->getNamespace(), '|') . '[<>]';
$arrayCache = new ArrayCache();
$cacheChain = new ChainCache([$arrayCache, $cacheProvider]);
$cacheProvider = new Wrapper($cacheChain);
$cacheProvider->setNamespace($namespace);
$this->cacheProvider = $cacheProvider;
$this->readConnection->setCacheProvider($cacheProvider);
if ($this->writeConnection) {
$this->writeConnection->setCacheProvider($cacheProvider);
}
}
示例7: getNamespace
/**
* {@inheritdoc}
*/
public function getNamespace()
{
return $this->provider->getNamespace();
}