Cache Manager

Tomahawk's cache is built around Doctrine's Cache Component.

The easiest way to use the Cache Manager is to make sure your Controllers extend Tomahawk\Routing\Controller. You then have access to it through $this->cache.

Other wise just add the following parameter to the construct method of your Controller Tomahawk\Cache\CacheInterface and it will get injected in through the Service Container.

Using The Cache Manager


Putting something in the cache

You can put something in the cache by doing the following:

Getting something out of the cache

You can get something out of the cache by doing the following:

Checking if something is in the cache

You can check if something is in the cache by doing the following:

Remove something from the cache

You can remove something from the cache by doing the following:

Flush the cache

You can flush everything from the cache by doing the following: