PHP code example of rickysu / cacheable-behavior-bundle
1. Go to this page and download the library: Download rickysu/cacheable-behavior-bundle 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/ */
rickysu / cacheable-behavior-bundle example snippets
// filter by id =1 and build cache
$Member=MemberPeer::retrieveByPk(1);
$Member=MemberQuery::create()->findPk(1);
//filter by username , email and build cache
$Member=MemberPeer::retrieveByUsernameEmail('username','[email protected]');
$Member=MemberQuery::create()
->filterByUsername('username')
->filterByEmail('[email protected]')
->findOne();
//delete cache when save or delete
$Member->save();
$Member->delete();
//set $Article belonds to $Category1
$Article->setCategory($Category1);
$Article->save();
//set $Article belonds to $Category2
$Article->setCategory($Category2);
$Article->save();
//we need to clear $Category1 and $Category2 reference cache.
php composer.phar install