1. Go to this page and download the library: Download bigpaulie/cachebundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bigpaulie / cachebundle example snippets
$bundles = array(
...
new bigpaulie\CacheBundle\BigpaulieCacheBundle(),
);
use bigpaulie\CacheBundle\Doctrine\Support\Cacheable;
use Doctrine\ORM\EntityRepository;
/**
* SomeRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class SomeRepository extends EntityRepository
{
use Cacheable;
}
// No caching
$this->getDoctrine()->getRepository('SomeBundle:SomeEntity')->find(1);
// Caching for 3600 seconds
$this->getDoctrine()->getRepository('SomeBundle:SomeEntity')->find(1, 3600);
// Caching for 3600 seconds and passing a Closure
$this->getDoctrine()->getRepository('SomeBundle:SomeEntity')->find(1, 3600, function () {
return new NullObject();
});
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.