Classes, traits, and interfaces - 10.3.x - drupal

Primary tabs

Introduction to classes

A lot of the PHP code in Drupal is object oriented (OO), making use of PHP classes, interfaces, and traits. See the Objected-oriented programming conventions for more information.

See also

Objected-oriented programming conventions

File

core/core.api.php, line 1518

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
EntityAdapter class Drupal\Core\Entity\Plugin\DataType core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php Defines the "entity" data type. 1 10
EntityAdapterUnitTest class Drupal\Tests\Core\Entity\TypedData core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php @coversDefaultClass \Drupal\Core\Entity\Plugin\DataType\EntityAdapter[[api-linebreak]] @group Entity @group TypedData
EntityAddUITest class Drupal\Tests\system\Functional\Entity core/modules/system/tests/src/Functional/Entity/EntityAddUITest.php Tests the /add and /add/{type} controllers.
EntityAliasTest class Drupal\Tests\path_alias\Kernel core/modules/path_alias/tests/src/Kernel/EntityAliasTest.php Tests path alias on entities.
EntityApiTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php Tests basic CRUD functionality.
EntityArgument class Drupal\views\Plugin\views\argument core/modules/views/src/Plugin/views/argument/EntityArgument.php Argument handler to accept an entity ID value. 5 5
EntityArgumentTest class Drupal\Tests\views\Functional\Plugin core/modules/views/tests/src/Functional/Plugin/EntityArgumentTest.php Tests the handler of the view: entity target argument.
EntityArgumentUpdateTest class Drupal\Tests\views\Functional\Update core/modules/views/tests/src/Functional/Update/EntityArgumentUpdateTest.php Tests the upgrade path for converting numeric arguments to entity_target_id.
EntityAutocomplete class Drupal\Core\Entity\Element core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php Provides an entity autocomplete form element. 4
EntityAutocompleteController class Drupal\system\Controller core/modules/system/src/Controller/EntityAutocompleteController.php Defines a route controller for entity autocomplete form elements. 1
EntityAutocompleteElementFormTest class Drupal\KernelTests\Core\Entity\Element core/tests/Drupal/KernelTests/Core/Entity/Element/EntityAutocompleteElementFormTest.php Tests the EntityAutocomplete Form API element.
EntityAutocompleteMatcher class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityAutocompleteMatcher.php Matcher class to get autocompletion results for entity reference. 2
EntityAutocompleteMatcherInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityAutocompleteMatcherInterface.php 1 1
EntityAutocompleteTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityAutocompleteTest.php Tests the autocomplete functionality.
EntityBase abstract class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityBase.php Defines a base entity class. 8 7
EntityBaseFieldOverride class Drupal\migrate\Plugin\migrate\destination core/modules/migrate/src/Plugin/migrate/destination/EntityBaseFieldOverride.php Provides entity base field override destination plugin.
EntityBaseTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityBaseTest.php Tests the functionality provided by \Drupal\Core\Entity\EntityBase.
EntityBaseTest class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php
EntityBaseTest class Drupal\Tests\Core\Entity\KeyValueStore core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
EntityBlock class Drupal\block\Plugin\migrate\destination core/modules/block/src/Plugin/migrate/destination/EntityBlock.php Migrate destination for block entity.
EntityBundle class Drupal\Core\Entity\Plugin\Condition\Deriver core/lib/Drupal/Core/Entity/Plugin/Condition/Deriver/EntityBundle.php Deriver that creates a condition for each entity type with bundles. 1
EntityBundle class Drupal\Core\Entity\Plugin\Condition core/lib/Drupal/Core/Entity/Plugin/Condition/EntityBundle.php Provides the 'Entity Bundle' condition.
EntityBundleConditionTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityBundleConditionTest.php Tests that entity bundle conditions works properly.
EntityBundleExistsConstraint class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EntityBundleExistsConstraint.php Checks if a bundle exists on a certain content entity type.
EntityBundleExistsConstraintValidator class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/EntityBundleExistsConstraintValidator.php Validates that a bundle exists on a certain content entity type.
EntityBundleExistsConstraintValidatorTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityBundleExistsConstraintValidatorTest.php @group Entity @group Validation
EntityBundleFieldTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityBundleFieldTest.php Tests adding a custom bundle field.
EntityBundleListCacheTest class Drupal\FunctionalTests\Entity core/tests/Drupal/FunctionalTests/Entity/EntityBundleListCacheTest.php Tests that bundle tags are invalidated when entities change.
EntityBundleListener class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityBundleListener.php Reacts to entity bundle CRUD on behalf of the Entity system. 2
EntityBundleListenerInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityBundleListenerInterface.php An interface for reacting to entity bundle creation and deletion. 2 1
EntityBundleListenerTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityBundleListenerTest.php @coversDefaultClass \Drupal\Core\Entity\EntityBundleListener[[api-linebreak]]
EntityBundleRouteEnhancer class Drupal\Core\Entity\Enhancer core/lib/Drupal/Core/Entity/Enhancer/EntityBundleRouteEnhancer.php Sets the bundle parameter for routes with the _field_ui option. 2
EntityCacheTagsTestBase abstract class Drupal\Tests\system\Functional\Entity core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php Provides helper methods for Entity cache tags tests. 3 2
EntityChangedActionDeriver class Drupal\Core\Action\Plugin\Action\Derivative core/lib/Drupal/Core/Action/Plugin/Action/Derivative/EntityChangedActionDeriver.php Provides an action deriver that finds entity types of EntityChangedInterface. 2
EntityChangedConstraint class Drupal\Core\Entity\Plugin\Validation\Constraint core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraint.php Validation constraint for the entity changed timestamp. 1 1
EntityChangedConstraintValidator class Drupal\Core\Entity\Plugin\Validation\Constraint core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraintValidator.php Validates the EntityChanged constraint. 1 1
EntityChangedInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityChangedInterface.php Defines an interface for entity change timestamp tracking. 12 20
EntityChangedTrait trait Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityChangedTrait.php Provides a trait for accessing changed time. 6
EntityChangesDetectionTrait trait Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityChangesDetectionTrait.php Provides helper methods to detect changes in an entity object. 2
EntityComment class Drupal\comment\Plugin\migrate\destination core/modules/comment/src/Plugin/migrate/destination/EntityComment.php Comment entity destination.
EntityCommentType class Drupal\comment\Plugin\migrate\destination core/modules/comment/src/Plugin/migrate/destination/EntityCommentType.php Comment type destination.
EntityComputedFieldTest class Drupal\Tests\system\Functional\Entity core/modules/system/tests/src/Functional/Entity/EntityComputedFieldTest.php Tests that entities with computed fields work correctly.
EntityCondition class Drupal\jsonapi\Query core/modules/jsonapi/src/Query/EntityCondition.php A condition object for the EntityQuery. 2
EntityConditionGroup class Drupal\jsonapi\Query core/modules/jsonapi/src/Query/EntityConditionGroup.php A condition group for the EntityQuery. 2
EntityConditionGroupTest class Drupal\Tests\jsonapi\Unit\Query core/modules/jsonapi/tests/src/Unit/Query/EntityConditionGroupTest.php @coversDefaultClass \Drupal\jsonapi\Query\EntityConditionGroup[[api-linebreak]] @group jsonapi
EntityConditionTest class Drupal\Tests\jsonapi\Unit\Query core/modules/jsonapi/tests/src/Unit/Query/EntityConditionTest.php @coversDefaultClass \Drupal\jsonapi\Query\EntityCondition[[api-linebreak]] @group jsonapi
EntityConfigBase class Drupal\migrate\Plugin\migrate\destination core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php Base destination class for importing configuration entities. 13 10
EntityConfirmFormBase abstract class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php Provides a generic base class for an entity-based confirmation form. 7 6
EntityConstraintViolationList class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityConstraintViolationList.php Implements an entity constraint violation list. 2
EntityConstraintViolationListInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityConstraintViolationListInterface.php Interface for the result of entity validation. 1 10

Other projects


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.