private function getTreeContent($uuid, $locale, $webspaceKey, $webspaceNodes, MappingInterface $mapping, UserInterface $user)
{
if (!in_array($webspaceNodes, [static::WEBSPACE_NODE_SINGLE, static::WEBSPACE_NODES_ALL, null])) {
throw new ParameterDataTypeException(get_class($this), 'webspace-nodes');
}
try {
$contents = $this->get('sulu_content.content_repository')->findParentsWithSiblingsByUuid($uuid, $locale, $webspaceKey, $mapping, $user);
} catch (ItemNotFoundException $e) {
throw new EntityNotFoundException('node', $uuid, $e);
}
if ($webspaceNodes === static::WEBSPACE_NODES_ALL) {
$contents = $this->getWebspaceNodes($mapping, $contents, $webspaceKey, $locale, $user);
} elseif ($webspaceNodes === static::WEBSPACE_NODE_SINGLE) {
$contents = $this->getWebspaceNode($mapping, $contents, $webspaceKey, $locale, $user);
}
$view = $this->view(new CollectionRepresentation($contents, static::$relationName));
return $this->handleView($view);
}