Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Orm
orm cache
atabak
February 2017
hi, ican't find orm cache document in document!
i need cache orm query and delete cache if i want.
thanks
Harro
February 2017
You mean cache the result of a query?
atabak
February 2017
query and result
Harro
February 2017
Accepted Answer
Example of caching a result (from the Auth ACL driver):
// get the list of valid roles
try
{
static::$_valid_roles = \Cache::get(\Config::get('ormauth.cache_prefix', 'auth').'.roles');
}
catch (\CacheNotFoundException $e)
{
static::$_valid_roles = \Model\Auth_Role::find('all');
\Cache::set(\Config::get('ormauth.cache_prefix', 'auth').'.roles', static::$_valid_roles);
}
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,089
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
261
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
atabak
February 2017
Harro
February 2017