/** * Build block library for a content entity. * * @param RouteMatch $route_match * The route match object. * * @return array */ public function contentBlockLibrary(RouteMatch $route_match) { $parameters = $route_match->getParameters(); $entity_type_id = $parameters->get('entity_type_id'); /** @var ContentEntityInterface $content_entity */ $content_entity = $parameters->get($entity_type_id); $entity_layout = $this->entityLayoutManager->getEntityLayout($entity_type_id, $content_entity->bundle()); return $this->buildBlockLibrary($entity_layout, $content_entity); }