public function cache($cache = null)
{
if ($cache === null) {
return $this->_cache;
}
if ($cache === false) {
$this->_cache = false;
return $this;
}
if ($cache === true) {
$cache = 'cake_pdf';
}
if (!in_array($cache, Cache::configured())) {
throw new Exception(sprintf('CakePdf cache is not configured: %s', $cache));
}
$this->_cache = $cache;
return $this;
}