phpdoc/Patterns/Interfaces/CachableInterface.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="robots" content="index, follow, all" />
<title>Patterns\Interfaces\CachableInterface | Patterns</title>
<link rel="stylesheet" type="text/css" href="../../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../../css/bootstrap-theme.min.css">
<link rel="stylesheet" type="text/css" href="../../css/sami.css">
<script src="../../js/jquery-1.11.1.min.js"></script>
<script src="../../js/bootstrap.min.js"></script>
<script src="../../js/typeahead.min.js"></script>
<script src="../../sami.js"></script>
<meta name="MobileOptimized" content="width">
<meta name="HandheldFriendly" content="true">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
</head>
<body id="class" data-name="class:Patterns_Interfaces_CachableInterface" data-root-path="../../">
<div id="content">
<div id="left-column">
<div id="control-panel">
<form id="search-form" action="../../search.html" method="GET">
<span class="glyphicon glyphicon-search"></span>
<input name="search"
class="typeahead form-control"
type="search"
placeholder="Search">
</form>
</div>
<div id="api-tree"></div>
</div>
<div id="right-column">
<nav id="site-nav" class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-elements">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../../index.html">Patterns</a>
</div>
<div class="collapse navbar-collapse" id="navbar-elements">
<ul class="nav navbar-nav">
<li><a href="../../classes.html">Classes</a></li>
<li><a href="../../namespaces.html">Namespaces</a></li>
<li><a href="../../interfaces.html">Interfaces</a></li>
<li><a href="../../traits.html">Traits</a></li>
<li><a href="../../doc-index.html">Index</a></li>
<li><a href="../../search.html">Search</a></li>
</ul>
</div>
</div>
</nav>
<div class="namespace-breadcrumbs">
<ol class="breadcrumb">
<li><span class="label label-default">interface</span></li>
<li><a href="../../Patterns.html">Patterns</a></li>
<li><a href="../../Patterns/Interfaces.html">Interfaces</a></li>
<li>CachableInterface</li>
</ol>
</div>
<div id="page-content">
<div class="page-header">
<h1>CachableInterface</h1>
</div>
<p> interface
<strong>CachableInterface</strong>
</p>
<div class="description">
<p>Manage a cachable item object</p> <p>This interface is designed to handle a single item at once but it can be used with any
iterable object.</p>
<p>Configuration like <code>cache_directory</code> or <code>max_cache_time</code> is not handled as it may depend
on your implementation.</p> </div>
<h2>Methods</h2>
<div class="container-fluid underlined">
<div class="row">
<div class="col-md-2 type">
string
</div>
<div class="col-md-8 type">
<a href="#method_getCacheKey">getCacheKey</a>()
<p>Get the key of the current cached item</p> </div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2 type">
bool
</div>
<div class="col-md-8 type">
<a href="#method_isCached">isCached</a>()
<p>Test if an item is already cached and if its cache is still valid</p> </div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2 type">
mixed
</div>
<div class="col-md-8 type">
<a href="#method_getCache">getCache</a>()
<p>Get a cache content for an item</p> </div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2 type">
bool
</div>
<div class="col-md-8 type">
<a href="#method_setCache">setCache</a>(
mixed $content)
<p>Set a cache content for an item</p> </div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2 type">
bool
</div>
<div class="col-md-8 type">
<a href="#method_invalidateCache">invalidateCache</a>()
<p>Clear a cache content for an item</p> </div>
<div class="col-md-2"></div>
</div>
</div>
<h2>Details</h2>
<div id="method-details">
<div class="method-item">
<h3 id="method_getCacheKey">
<div class="location">at line 45</div>
<code>
string
<strong>getCacheKey</strong>()</code>
</h3>
<div class="details">
<div class="method-description">
<p>Get the key of the current cached item</p> <p>This should transform an item identifier (such as a title) into a uniq key.</p> </div>
<div class="tags">
<h4>Return Value</h4>
<table class="table table-condensed">
<tr>
<td>
string</td>
<td>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="method-item">
<h3 id="method_isCached">
<div class="location">at line 57</div>
<code>
bool
<strong>isCached</strong>()</code>
</h3>
<div class="details">
<div class="method-description">
<p>Test if an item is already cached and if its cache is still valid</p> <p>This may check if a cache exists for the item and if it seems always valid ; validity
may be tested for a static duration time (a <code>max_cache_time</code>) and could be checked
comparing the creation time of the cache entry and the last modification time of the
source if it is possible.</p> </div>
<div class="tags">
<h4>Return Value</h4>
<table class="table table-condensed">
<tr>
<td>
bool</td>
<td>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="method-item">
<h3 id="method_getCache">
<div class="location">at line 66</div>
<code>
mixed
<strong>getCache</strong>()</code>
</h3>
<div class="details">
<div class="method-description">
<p>Get a cache content for an item</p> <p>This must return the exact same content passed at the <code>setCache()</code> method.</p> </div>
<div class="tags">
<h4>Return Value</h4>
<table class="table table-condensed">
<tr>
<td>
mixed</td>
<td>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="method-item">
<h3 id="method_setCache">
<div class="location">at line 77</div>
<code>
bool
<strong>setCache</strong>(
mixed $content)</code>
</h3>
<div class="details">
<div class="method-description">
<p>Set a cache content for an item</p> <p>This must store the content in association with the item key ; the method could
return a boolean indicates if the caching process succeeded.</p> </div>
<div class="tags">
<h4>Parameters</h4>
<table class="table table-condensed">
<tr>
<td>
mixed</td>
<td>$content</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table class="table table-condensed">
<tr>
<td>
bool</td>
<td>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="method-item">
<h3 id="method_invalidateCache">
<div class="location">at line 87</div>
<code>
bool
<strong>invalidateCache</strong>()</code>
</h3>
<div class="details">
<div class="method-description">
<p>Clear a cache content for an item</p> <p>This must clear the cached content associated with the item key ; the method could
return a boolean indicates if the deletion process succeeded.</p> </div>
<div class="tags">
<h4>Return Value</h4>
<table class="table table-condensed">
<tr>
<td>
bool</td>
<td>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div id="footer">
Generated by <a href="http://sami.sensiolabs.org/">Sami, the API Documentation Generator</a>.
</div>
</div>
</div>
</body>
</html>