/**
* {@inheritdoc}
*/
public function getById($id, $locale, $depth = 0, $breadcrumb = false, $filter = [], $sortBy = [])
{
$collectionEntity = $this->collectionRepository->findCollectionById($id);
if ($collectionEntity === null) {
throw new CollectionNotFoundException($id);
}
$filter['locale'] = $locale;
$collectionChildren = $this->collectionRepository->findCollectionSet($depth, $filter, $collectionEntity, $sortBy);
$breadcrumbEntities = null;
if ($breadcrumb) {
$breadcrumbEntities = $this->collectionRepository->findCollectionBreadcrumbById($id);
}
return $this->getApiEntity($collectionEntity, $locale, $collectionChildren, $breadcrumbEntities);
}