private function removeResource(PuliResource $resource)
{
$path = $resource->getPath();
$this->removeVersions($path);
// Ignore non-existing resources
if (!isset($this->resources[$path])) {
return;
}
// Recursively remove directory contents
foreach ($this->getChildIterator($resource) as $child) {
$this->removeResource($child);
}
unset($this->resources[$path]);
// Detach from locator
$resource->detach();
}