. namespace hoplite\views; /*! CacheBackend is used by the TemplateLoader to store and retrieve compiled templates. */ interface CacheBackend { /*! Gets the compiled template data for the template of the given name. If the template modification time is newer than what is stored in the cache, this function should discard the item and return NULL. @param string The name of the template. @param int The UNIX timestamp the uncompiled template was last modified. @return string|NULL The cached template data, or NULL if it is not cached. */ public function GetTemplateDataForName($name, $modification_time); /*! Stores the compiled template data into the cache with the given name and template modification time. @param string The name of the template. @param string The compiled template data. @param int The UNIX timestamp the uncompiled template was last modified. */ public function StoreCompiledTemplate($name, $modification_time, $data); /*! Gets a set of templates from the cache in bulk. If the backend doesn't support bulk fetch operations, just loop over GetTemplateDataForName. @param array Map of template names to modification times. @return array Map of template names to data for templates that are present and valid in the cache. */ public function GetMultipleTemplates(Array $templates); }