protected function _cleaner($parentId, $preservedItems = [])
{
$nodes = $this->Aco->find()->where(['parent_id' => $parentId]);
$methodFlip = array_flip($preservedItems);
foreach ($nodes as $node) {
if (!isset($methodFlip[$node->alias])) {
$crumbs = $this->Aco->find('path', ['for' => $node->id, 'order' => 'lft']);
$path = null;
foreach ($crumbs as $crumb) {
$path .= '/' . $crumb->alias;
}
$entity = $this->Aco->get($node->id);
if ($this->Aco->delete($entity)) {
$this->out(__d('cake_acl', 'Deleted Aco node: <warning>{0}</warning> and all children', $path));
}
}
}
}