If specific, it will also destroy the cache of the parent
$opt->option->deleteCache(25)
// This is chainable
// ->...
function(string $id = NULL, $deep = false, $subs = false)
{
if ($this->check()) {
if (bbn\Str::isUid($id)) {
if (($deep || !$subs) && ($items = $this->items($id))) {
foreach ($items as $it){
$this->deleteCache($it, $deep, true);
}
}
if (!$subs && ($id_alias = $this->alias($id))) {
$this->deleteCache($id_alias, false, true);
}
$this->cacheDelete($id);
if (!$subs) {
$this->cacheDelete($this->getIdParent($id));
}
}
elseif (is_null($id)) {
$this->cacheDeleteAll();
}
}
return $this;
}