private function getReferencedNodes($ids, $weak)
{
$results = array();
$nodes = $this->objectManager->getNodesByIdentifier($ids);
$missing = array();
foreach ($ids as $id) {
if (isset($nodes[$id])) {
$results[] = $nodes[$id];
} else {
$missing[$id] = $id;
}
}
if (count($missing)) {
if ($weak) {
throw new ItemNotFoundException(sprintf('One or more weak reference targets have not been found: "%s".', implode('", "', $missing)));
} else {
throw new RepositoryException(sprintf('Internal Error: Could not find one or more referenced nodes: "%s". ' . 'If the referencing node is a frozen version, this can happen, otherwise it would be a bug.', implode('", "', $missing)));
}
}
return $results;
}