PHP code example of kozz / yii-doctrine-cache

1. Go to this page and download the library: Download kozz/yii-doctrine-cache 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/ */

    

kozz / yii-doctrine-cache example snippets



//SomeFile.php
use Kozz\Yii1\Cache\YiiDoctrineCache;

$cache = new YiiDoctrineCache();
$cache->save('id', 'value');

//SomeOtherFile.php
use Kozz\Yii1\Cache\YiiDoctrineCache;

$cache = new YiiDoctrineCache();
$cache->fetch('id'); // 'value'


fetch($id)
save($id, $data, $lifeTime = false)
delete($id)