Looking to hire Laravel developers? Try LaraJobs

laravel-doctrine-cache maintained by kozz

Description
Doctrine Cache Factory for Laravel 5
Author
Last update
2015/05/20 14:50 (dev-master)
License
Downloads
9 513

Comments
comments powered by Disqus

Laravel Docrtine Cache Proxy

Build Status Code Climate Test Coverage Latest Stable Version Latest Unstable Version License

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