DoctrineCache.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Cache\Simple;
  11. use Doctrine\Common\Cache\CacheProvider;
  12. use Symfony\Component\Cache\Adapter\DoctrineAdapter;
  13. use Symfony\Component\Cache\Traits\DoctrineTrait;
  14. use Symfony\Contracts\Cache\CacheInterface;
  15. @trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3, use "%s" and type-hint for "%s" instead.', DoctrineCache::class, DoctrineAdapter::class, CacheInterface::class), \E_USER_DEPRECATED);
  16. /**
  17. * @deprecated since Symfony 4.3, use DoctrineAdapter and type-hint for CacheInterface instead.
  18. */
  19. class DoctrineCache extends AbstractCache
  20. {
  21. use DoctrineTrait;
  22. public function __construct(CacheProvider $provider, string $namespace = '', int $defaultLifetime = 0)
  23. {
  24. parent::__construct('', $defaultLifetime);
  25. $this->provider = $provider;
  26. $provider->setNamespace($namespace);
  27. }
  28. }