} // If no match was found check if it is a bundle class. This needs to be in
// a separate loop to avoid false positives, since an entity class can
// subclass another entity class.
if (!
$entity_type_id) { foreach ($definitions as $entity_type) { if (is_subclass_of($class_name,
$entity_type->
getOriginalClass()) ||
is_subclass_of($class_name,
$entity_type->
getClass())) { $entity_type_id =
$entity_type->
id();
if ($same_class++
) { throw new AmbiguousBundleClassException($class_name);
} } } } // Return the matching entity type ID if there is one.
if ($entity_type_id) { $this->classNameEntityTypeMap
[$class_name] =
$entity_type_id;
return $entity_type_id;
}