By berdir on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.3.x
Introduced in version:
8.3.0
Issue links:
Description:
The method rename was done to avoid confusion why a method exists for this and what the difference is compared to just calling is_subclass_of() or instanceof directly.
It exists to be able check if the entity class that the entity type definition represents implements a certain interface, usually FieldableEntityInterface or ConfigEntityInterface but also others that entity types can optionaly implement.
The method was renamed to entityClassImplements to make its purpose clear. and otherwise continues to work as it did before:
Before
if ($entity_type->isSubclassOf(FieldableEntityInterface::CLASS)) {
After
if ($entity_type->entityClassImplements(FieldableEntityInterface::CLASS)) {
The old method still works but will be removed in Drupal 9.
Impacts:
Module developers