public function cacheTemplates($path)
{
try {
$items = array();
foreach ($this->storage->listItems($path) as $file) {
$storageFile = $this->storage->getItem($file);
if (!$storageFile->isDir() && $storageFile->getType() == 'tpl') {
$items[] = $this->repository->getTemplate($storageFile);
}
}
return $this->repository->flush();
} catch (\InvalidArgumentException $e) {
throw new \InvalidArgumentException(sprintf("'%s' not found", $path), $e->getCode(), $e);
}
}