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

Name Type Namespace Location Description Direct usessort ascending Use statements Strings
UnitTestCase abstract class Drupal\Tests core/tests/Drupal/Tests/UnitTestCase.php Provides a base class and helpers for Drupal unit tests. 590 588
WebDriverTestBase abstract class Drupal\FunctionalJavascriptTests core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php Runs a browser test using a driver that supports JavaScript. 149 144
FormBase abstract class Drupal\Core\Form core/lib/Drupal/Core/Form/FormBase.php Provides a base class for forms. 142 140
ViewsKernelTestBase abstract class Drupal\Tests\views\Kernel core/modules/views/tests/src/Kernel/ViewsKernelTestBase.php Defines a base class for Views kernel testing. 123 107
MigrateDrupal6TestBase abstract class Drupal\Tests\migrate_drupal\Kernel\d6 core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6TestBase.php Base class for Drupal 6 migration tests. 111 105
MigrateDrupal7TestBase abstract class Drupal\Tests\migrate_drupal\Kernel\d7 core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7TestBase.php Base class for Drupal 7 migration tests. 103 98
MigrateSqlSourceTestBase abstract class Drupal\Tests\migrate\Kernel core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php Base class for tests of Migrate source plugins that use a database. 99 98
ViewTestBase abstract class Drupal\Tests\views\Functional core/modules/views/tests/src/Functional/ViewTestBase.php Defines a base class for Views testing in the full web test environment. 82 67
ContainerInjectionInterface interface Drupal\Core\DependencyInjection core/lib/Drupal/Core/DependencyInjection/ContainerInjectionInterface.php Defines a common interface for dependency container injection. 75 75
ControllerBase abstract class Drupal\Core\Controller core/lib/Drupal/Core/Controller/ControllerBase.php Utility base class for thin controllers. 74 74
EntityKernelTestBase abstract class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBase.php Defines an abstract test base for entity kernel tests. 72 37
DrupalSqlBase abstract class Drupal\migrate_drupal\Plugin\migrate\source core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php A base class for source plugins using a Drupal database as a source. 67 65
ContainerFactoryPluginInterface interface Drupal\Core\Plugin core/lib/Drupal/Core/Plugin/ContainerFactoryPluginInterface.php Defines an interface for pulling plugin dependencies from the container. 59 62
UpdatePathTestBase abstract class Drupal\FunctionalTests\Update core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php Provides a base class for writing an update test. 48 47
CacheableDependencyInterface interface Drupal\Core\Cache core/lib/Drupal/Core/Cache/CacheableDependencyInterface.php Defines an interface for objects which may be used by other cached objects. 47 68
UITestBase abstract class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/UITestBase.php Provides a base class for testing the Views UI. 44 5
Plugin class Drupal\Component\Annotation core/lib/Drupal/Component/Annotation/Plugin.php Defines a Plugin annotation object. 42 41
PluginBase abstract class Drupal\Core\Plugin core/lib/Drupal/Core/Plugin/PluginBase.php Base class for plugins supporting metadata inspection and translation. 39 38
InstallerTestBase abstract class Drupal\FunctionalTests\Installer core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php Base class for testing the interactive installer. 39 4
DeriverBase abstract class Drupal\Component\Plugin\Derivative core/lib/Drupal/Component/Plugin/Derivative/DeriverBase.php Provides a basic deriver. 38 38
EntityTest class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php Defines the test entity class. 37 145
ContainerDeriverInterface interface Drupal\Core\Plugin\Discovery core/lib/Drupal/Core/Plugin/Discovery/ContainerDeriverInterface.php Creates additional plugin definitions. 36 36
ConfigEntityResourceTestBase abstract class Drupal\Tests\rest\Functional\EntityResource core/modules/rest/tests/src/Functional/EntityResource/ConfigEntityResourceTestBase.php Resource test base class for config entities. 34 35
FormInterface interface Drupal\Core\Form core/lib/Drupal/Core/Form/FormInterface.php Provides an interface for a Form. 34 34
AccessInterface interface Drupal\Core\Routing\Access core/lib/Drupal/Core/Routing/Access/AccessInterface.php An access check service determines access rules for particular routes. 34 34
EntityAccessControlHandler class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php Defines a default implementation for entity access control handler. 33 34
NodeTestBase abstract class Drupal\Tests\node\Functional core/modules/node/tests/src/Functional/NodeTestBase.php Sets up page and article content types. 32 3
DatabaseTestBase abstract class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/DatabaseTestBase.php Base class for databases database tests. 32
PluginInspectionInterface interface Drupal\Component\Plugin core/lib/Drupal/Component/Plugin/PluginInspectionInterface.php Plugin interface for providing some metadata inspection. 32 40
ConfigEntityResourceTestBase abstract class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/ConfigEntityResourceTestBase.php Resource test base class for config entities. 31 2
RenderElementBase abstract class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/RenderElementBase.php Provides a base class for render element plugins. 31 15
ConfigEntityInterface interface Drupal\Core\Config\Entity core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php Defines a common interface for configuration entities. 31 58
ConfirmFormBase abstract class Drupal\Core\Form core/lib/Drupal/Core/Form/ConfirmFormBase.php Provides a generic base class for a confirmation form. 28 28
FormElementBase abstract class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/FormElementBase.php Provides a base class for form element plugins. 28 3
TrustedCallbackInterface interface Drupal\Core\Security core/lib/Drupal/Core/Security/TrustedCallbackInterface.php Interface to declare trusted callbacks. 28 27
MigrateProcessTestCase abstract class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/MigrateProcessTestCase.php 27 8
CommandInterface interface Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/CommandInterface.php AJAX command interface. 27 7
Event class Drupal\Component\EventDispatcher core/lib/Drupal/Component/EventDispatcher/Event.php Provides a forward-compatibility layer for the Symfony 5 event class. 25 29
FieldItemBase abstract class Drupal\Core\Field core/lib/Drupal/Core/Field/FieldItemBase.php An entity field item. 25 27
EntityForm class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityForm.php Base class for entity forms. 24 23
CommentTestBase abstract class Drupal\Tests\comment\Functional core/modules/comment/tests/src/Functional/CommentTestBase.php Provides setup and helper methods for comment tests. 24 2
DatabaseException interface Drupal\Core\Database core/lib/Drupal/Core/Database/DatabaseException.php Interface for a database exception. 23 18
PluginFormInterface interface Drupal\Core\Plugin core/lib/Drupal/Core/Plugin/PluginFormInterface.php Provides an interface for an embeddable plugin form. 21 27
CacheContextInterface interface Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/CacheContextInterface.php Provides an interface for defining a cache context service. 21 6
ConfigEntityBase abstract class Drupal\Core\Config\Entity core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php 20 22
MigrateTestBase abstract class Drupal\Tests\migrate\Kernel core/modules/migrate/tests/src/Kernel/MigrateTestBase.php Creates abstract base class for migration tests. 19 6
PluginManagerInterface interface Drupal\Component\Plugin core/lib/Drupal/Component/Plugin/PluginManagerInterface.php Interface implemented by plugin managers. 19 39
MediaFunctionalTestBase abstract class Drupal\Tests\media\Functional core/modules/media/tests/src/Functional/MediaFunctionalTestBase.php Base class for Media functional tests. 18 3
TaxonomyTestBase abstract class Drupal\Tests\taxonomy\Functional core/modules/taxonomy/tests/src/Functional/TaxonomyTestBase.php Provides common helper methods for Taxonomy module tests. 18
DependentPluginInterface interface Drupal\Component\Plugin core/lib/Drupal/Component/Plugin/DependentPluginInterface.php Provides an interface for a plugin that has dependencies. 18 20

Pages

Other projects