Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
orm cache
  • hi, ican't find orm cache document in document!
    i need cache orm query and delete cache if i want.
    thanks
  • You mean cache the result of a query?
  • query and result
  • HarroHarro
    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);
    }

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion