kozz / laravel-doctrine-cache
Doctrine Cache Factory for Laravel 5
Installs: 9 513
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
pkg:composer/kozz/laravel-doctrine-cache
Requires
- php: >=5.4.0
- doctrine/cache: ~1.4
- laravel/framework: ~5.0
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- phpunit/phpunit: ~4.2
Suggests
- php: >=5.6.2
This package is not auto-updated.
Last update: 2025-10-25 22:58:30 UTC
README
Laravel Proxy to Doctrine Cache
When to use
LaravelDoctrineCache implements Doctrine\Common\Cache\Cache interface
so it's fully compatible with all libraries that are requiring Doctrine Cache such as:
- Doctrine Annotation Reader
- Symfony Validator
- JMS Serializer
How does it work
LaravelDoctrineCache is using cache from app container : Container::getInstance()->offsetGet('cache') and points Doctrine\Common\Cache\Cache methods to suitable Laravel Cache methods
Examples
#JMS\Serializer $serializer = \JMS\Serializer\SerializerBuilder::create() ->setAnnotationReader(new CachedReader(new AnnotationReader(), new LaravelDoctrineCache())) ->build();
Reference
Methods
fetch($id) - Fetches an entry from the cache
contains($id) - Test if an entry exists in the cache
save($id, $data, $lifeTime = false) - Puts data into the cache
delete($id) - Deletes a cache entry