Chris@18: getEntityTypeId(); Chris@18: if (!isset($defaults[$entity_type_id]) || !($entity = $defaults[$entity_type_id])) { Chris@18: return $defaults; Chris@18: } Chris@18: $retrieved_bundle = $entity->bundle(); Chris@18: $configured_bundle = $resource_type->getBundle(); Chris@18: if ($retrieved_bundle != $configured_bundle) { Chris@18: // If the bundle in the loaded entity does not match the bundle in the Chris@18: // route (which is set based on the corresponding ResourceType), then Chris@18: // throw an exception. Chris@18: throw new NotFoundHttpException(sprintf('The loaded entity bundle (%s) does not match the configured resource (%s).', $retrieved_bundle, $configured_bundle)); Chris@18: } Chris@18: return $defaults; Chris@18: } Chris@18: Chris@18: }