Classes, traits, and interfaces - 11.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
ConfigConfigurator final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/ConfigConfigurator.php @internal This API is experimental.
ConfigConfiguratorTest class Drupal\KernelTests\Core\Recipe core/tests/Drupal/KernelTests/Core/Recipe/ConfigConfiguratorTest.php @covers \Drupal\Core\Recipe\ConfigConfigurator @group Recipe
ConfigController class Drupal\config\Controller core/modules/config/src/Controller/ConfigController.php Returns responses for config module routes.
ConfigCrudEvent class Drupal\Core\Config core/lib/Drupal/Core/Config/ConfigCrudEvent.php Wraps a configuration event for event listeners. 1 22
ConfigCRUDTest class Drupal\KernelTests\Core\Config core/tests/Drupal/KernelTests/Core/Config/ConfigCRUDTest.php Tests CRUD operations on configuration objects.
ConfigDependencies class Drupal\rest\Entity core/modules/rest/src/Entity/ConfigDependencies.php Calculates rest resource config dependencies. 1
ConfigDependenciesTest class Drupal\Tests\rest\Kernel\Entity core/modules/rest/tests/src/Kernel/Entity/ConfigDependenciesTest.php @coversDefaultClass \Drupal\rest\Entity\ConfigDependencies
ConfigDependencyDeleteFormTrait trait Drupal\Core\Config\Entity core/lib/Drupal/Core/Config/Entity/ConfigDependencyDeleteFormTrait.php Lists affected configuration entities by a dependency removal. 2
ConfigDependencyManager class Drupal\Core\Config\Entity core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php Provides a class to discover configuration entity dependencies. 6
ConfigDependencyManagerTest class Drupal\Tests\Core\Config core/tests/Drupal/Tests/Core/Config/ConfigDependencyManagerTest.php Tests the ConfigDependencyManager class.
ConfigDependencyManagerTest class Drupal\Tests\Core\Config\Entity core/tests/Drupal/Tests/Core/Config/Entity/ConfigDependencyManagerTest.php Tests the ConfigDependencyManager class.
ConfigDependencyTest class Drupal\KernelTests\Core\Config core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php Tests for configuration dependencies.
ConfigDependencyWebTest class Drupal\Tests\config\Functional core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php Tests configuration entities.
ConfigDiffTest class Drupal\KernelTests\Core\Config core/tests/Drupal/KernelTests/Core/Config/ConfigDiffTest.php Calculating the difference between two sets of configuration.
ConfigDirectoryNotDefinedException class Drupal\Core\Config core/lib/Drupal/Core/Config/ConfigDirectoryNotDefinedException.php An exception thrown when the config sync directory is not defined. 1
ConfigDraggableListBuilderTest class Drupal\Tests\config\Functional core/modules/config/tests/src/Functional/ConfigDraggableListBuilderTest.php Tests draggable list builder.
ConfigDuplicateUUIDException class Drupal\Core\Config core/lib/Drupal/Core/Config/ConfigDuplicateUUIDException.php Exception thrown when a config object UUID causes a conflict. 3
ConfigEntityAdapter class Drupal\Core\Entity\Plugin\DataType core/lib/Drupal/Core/Entity/Plugin/DataType/ConfigEntityAdapter.php Enhances EntityAdapter for config entities. 5
ConfigEntityAdapterTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityAdapterTest.php Tests entity adapter for configuration entities.
ConfigEntityBase abstract class Drupal\Core\Config\Entity core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php Defines a base configuration entity class. 26 27
ConfigEntityBaseUnitTest class Drupal\Tests\Core\Config\Entity core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php @coversDefaultClass \Drupal\Core\Config\Entity\ConfigEntityBase @group Config
ConfigEntityBaseWithPluginCollections abstract class Drupal\Tests\Core\Config\Entity\Fixtures core/tests/Drupal/Tests/Core/Config/Entity/Fixtures/ConfigEntityBaseWithPluginCollections.php Enables testing of dependency calculation. 1 1
ConfigEntityBundleBase abstract class Drupal\Core\Config\Entity core/lib/Drupal/Core/Config/Entity/ConfigEntityBundleBase.php A base class for config entity types that act as bundles. 9 9
ConfigEntityDenormalizer final class Drupal\jsonapi\Normalizer core/modules/jsonapi/src/Normalizer/ConfigEntityDenormalizer.php Converts the Drupal config entity object to a JSON:API array structure. 2
ConfigEntityDependency class Drupal\Core\Config\Entity core/lib/Drupal/Core/Config/Entity/ConfigEntityDependency.php Provides a value object to discover configuration dependencies. 3
ConfigEntityDependencyTest class Drupal\Tests\Core\Config\Entity core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityDependencyTest.php Tests the ConfigEntityDependency class.
ConfigEntityFormOverrideTest class Drupal\Tests\config\Functional core/modules/config/tests/src/Functional/ConfigEntityFormOverrideTest.php Tests that config overrides do not bleed through in entity forms and lists.
ConfigEntityIdLengthException class Drupal\Core\Config\Entity\Exception core/lib/Drupal/Core/Config/Entity/Exception/ConfigEntityIdLengthException.php Defines an exception thrown when a configuration entity ID is too long. 5
ConfigEntityImportTest class Drupal\Tests\system\Kernel\Entity core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php Tests ConfigEntity importing.
ConfigEntityInterface interface Drupal\Core\Config\Entity core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php Defines a common interface for configuration entities. 31 71
ConfigEntityListBuilder class Drupal\Core\Config\Entity core/lib/Drupal/Core/Config/Entity/ConfigEntityListBuilder.php Defines the default class to build a listing of configuration entities. 20 20
ConfigEntityListMultilingualTest class Drupal\Tests\config\Functional core/modules/config/tests/src/Functional/ConfigEntityListMultilingualTest.php Tests the listing of configuration entities in a multilingual scenario.
ConfigEntityListTest class Drupal\Tests\config\Functional core/modules/config/tests/src/Functional/ConfigEntityListTest.php Tests the listing of configuration entities.
ConfigEntityMapper class Drupal\config_translation core/modules/config_translation/src/ConfigEntityMapper.php Configuration mapper for configuration entities. 2 2
ConfigEntityMapperInterface interface Drupal\config_translation core/modules/config_translation/src/ConfigEntityMapperInterface.php Defines an interface for configuration entity mappers. 1 1
ConfigEntityMapperTest class Drupal\Tests\config_translation\Unit core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php Tests the functionality provided by the configuration entity mapper.
ConfigEntityNormalizer class Drupal\serialization\Normalizer core/modules/serialization/src/Normalizer/ConfigEntityNormalizer.php Normalizes/denormalizes Drupal config entity objects into an array structure. 1 2 2
ConfigEntityNormalizerTest class Drupal\Tests\serialization\Unit\Normalizer core/modules/serialization/tests/src/Unit/Normalizer/ConfigEntityNormalizerTest.php @coversDefaultClass \Drupal\serialization\Normalizer\ConfigEntityNormalizer @group serialization
ConfigEntityNormalizeTest class Drupal\KernelTests\Core\Config core/tests/Drupal/KernelTests/Core/Config/ConfigEntityNormalizeTest.php Tests the listing of configuration entities.
ConfigEntityQueryTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php Tests Config Entity Query functionality.
ConfigEntityResourceTestBase abstract class Drupal\Tests\rest\Functional\EntityResource core/modules/rest/tests/src/Functional/EntityResource/ConfigEntityResourceTestBase.php Resource test base class for config entities. 37 38
ConfigEntityResourceTestBase abstract class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/ConfigEntityResourceTestBase.php Resource test base class for config entities. 32 3
ConfigEntityStaticCacheTest class Drupal\KernelTests\Core\Config core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStaticCacheTest.php Tests the entity static cache when used by config entities.
ConfigEntityStaticCacheTestHooks class Drupal\config_entity_static_cache_test\Hook core/modules/config/tests/config_entity_static_cache_test/src/Hook/ConfigEntityStaticCacheTestHooks.php Hook implementations for config_entity_static_cache_test.
ConfigEntityStatusTest class Drupal\KernelTests\Core\Config core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStatusTest.php Tests configuration entity status functionality.
ConfigEntityStatusUITest class Drupal\Tests\config\Functional core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php Tests configuration entity status UI functionality.
ConfigEntityStorage class Drupal\Core\Config\Entity core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php Defines the storage class for configuration entities. 9 17
ConfigEntityStorageClassException class Drupal\Core\Config\Entity\Exception core/lib/Drupal/Core/Config/Entity/Exception/ConfigEntityStorageClassException.php Thrown when a storage class is not an instance of ConfigEntityStorage. 2
ConfigEntityStorageInterface interface Drupal\Core\Config\Entity core/lib/Drupal/Core/Config/Entity/ConfigEntityStorageInterface.php Provides an interface for configuration entity storage. 5 9
ConfigEntityStorageTest class Drupal\Tests\Core\Config\Entity core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php @coversDefaultClass \Drupal\Core\Config\Entity\ConfigEntityStorage @group Config

Other projects


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