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
PluginID class Drupal\Component\Annotation core/lib/Drupal/Component/Annotation/PluginID.php Defines a Plugin annotation object that just contains an ID. 2 4
PluginID class Drupal\Component\Plugin\Attribute core/lib/Drupal/Component/Plugin/Attribute/PluginID.php Defines a Plugin attribute object that just contains an ID. 6 10
PluginIdTest class Drupal\Tests\Component\Annotation core/tests/Drupal/Tests/Component/Annotation/PluginIdTest.php @coversDefaultClass \Drupal\Component\Annotation\PluginId[[api-linebreak]] @group Annotation
PluginIdTest class Drupal\Tests\Component\Plugin\Attribute core/tests/Drupal/Tests/Component/Plugin/Attribute/PluginIdTest.php @coversDefaultClass \Drupal\Component\Plugin\Attribute\PluginId[[api-linebreak]] @group Attribute
PluginInspectionInterface interface Drupal\Component\Plugin core/lib/Drupal/Component/Plugin/PluginInspectionInterface.php Plugin interface for providing some metadata inspection. 33 43
PluginInstanceTest class Drupal\Tests\views\Kernel core/modules/views/tests/src/Kernel/PluginInstanceTest.php Tests that an instance of all views plugins can be created.
PluginKernelTestBase abstract class Drupal\Tests\views\Kernel\Plugin core/modules/views/tests/src/Kernel/Plugin/PluginKernelTestBase.php Base test class for views plugin unit tests. 4
PluginManager class Drupal\lazy_route_provider_install_test core/modules/system/tests/modules/lazy_route_provider_install_test/src/PluginManager.php 2
PluginManagerBase abstract class Drupal\Component\Plugin core/lib/Drupal/Component/Plugin/PluginManagerBase.php Base class for plugin managers. 6 10
PluginManagerBaseTest class Drupal\Tests\Component\Plugin core/tests/Drupal/Tests/Component/Plugin/PluginManagerBaseTest.php @coversDefaultClass \Drupal\Component\Plugin\PluginManagerBase[[api-linebreak]] @group Plugin
PluginManagerCacheClearer class Drupal\module_test core/modules/system/tests/modules/module_test/src/PluginManagerCacheClearer.php Helps test module uninstall. 1 2
PluginManagerDependentValidatorTrait trait Drupal\ckeditor5\Plugin\Validation\Constraint core/modules/ckeditor5/src/Plugin/Validation/Constraint/PluginManagerDependentValidatorTrait.php Common functionality for many CKEditor 5 validation constraints.
PluginManagerInterface interface Drupal\Component\Plugin core/lib/Drupal/Component/Plugin/PluginManagerInterface.php Interface implemented by plugin managers. 20 47
PluginManagerPass class Drupal\Core\Plugin core/lib/Drupal/Core/Plugin/PluginManagerPass.php Registers plugin managers to the plugin.cache_clearer service. 1
PluginNotFoundException class Drupal\Component\Plugin\Exception core/lib/Drupal/Component/Plugin/Exception/PluginNotFoundException.php Plugin exception class to be thrown when a plugin ID could not be found. 55
PluginSettingsBase abstract class Drupal\Core\Field core/lib/Drupal/Core/Field/PluginSettingsBase.php Base class for the Field API plugins. 3 1
PluginSettingsBaseTest class Drupal\Tests\Core\Field core/tests/Drupal/Tests/Core/Field/PluginSettingsBaseTest.php @coversDefaultClass \Drupal\Core\Field\PluginSettingsBase[[api-linebreak]] @group Field
PluginSettingsInterface interface Drupal\Core\Field core/lib/Drupal/Core/Field/PluginSettingsInterface.php Interface definition for plugin with settings. 3 3
PluginStub class Drupal\Tests\Component\Annotation core/tests/Drupal/Tests/Component/Annotation/PluginTest.php
PluginStub class Drupal\Tests\Component\Plugin\Attribute core/tests/Drupal/Tests/Component/Plugin/Attribute/PluginTest.php
PluginTest class Drupal\Tests\Component\Annotation core/tests/Drupal/Tests/Component/Annotation/PluginTest.php @coversDefaultClass \Drupal\Component\Annotation\Plugin[[api-linebreak]] @group Annotation
PluginTest class Drupal\Tests\Component\Plugin\Attribute core/tests/Drupal/Tests/Component/Plugin/Attribute/PluginTest.php @coversDefaultClass \Drupal\Component\Annotation\Plugin[[api-linebreak]] @group Attribute
PluginTestBase abstract class Drupal\KernelTests\Core\Plugin core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php Base class for Plugin API unit tests. 3
PluginTypeListTest class Drupal\Tests\views\Unit core/modules/views/tests/src/Unit/PluginTypeListTest.php Tests that list of plugin is correct.
PluginWithFormsInterface interface Drupal\Core\Plugin core/lib/Drupal/Core/Plugin/PluginWithFormsInterface.php Provides an interface for plugins which have forms. 3 10
PluginWithFormsTrait trait Drupal\Core\Plugin core/lib/Drupal/Core/Plugin/PluginWithFormsTrait.php Provides a trait with typical behavior for plugins which have forms. 3
PluginWithFormsTraitTest class Drupal\Tests\Core\Plugin core/tests/Drupal/Tests/Core/Plugin/PluginWithFormsTraitTest.php @coversDefaultClass \Drupal\Core\Plugin\PluginWithFormsTrait[[api-linebreak]] @group Plugin
PluralFormula class Drupal\locale core/modules/locale/src/PluralFormula.php Manages the storage of plural formula per language in state. 2
PluralFormulaInterface interface Drupal\locale core/modules/locale/src/PluralFormulaInterface.php An interface for a service providing plural formulae. 1
PluralTranslatableMarkup class Drupal\Core\StringTranslation core/lib/Drupal/Core/StringTranslation/PluralTranslatableMarkup.php A class to hold plural translatable markup. 19
PluralTranslatableMarkupTest class Drupal\Tests\Core\StringTranslation core/tests/Drupal/Tests/Core/StringTranslation/PluralTranslatableMarkupTest.php Tests the TranslatableMarkup class.
PluralTranslation class Drupal\Core\Annotation core/lib/Drupal/Core/Annotation/PluralTranslation.php Defines an annotation object for strings that require plural forms. 1
PluralTranslationTest class Drupal\Tests\Core\Annotation core/tests/Drupal/Tests/Core/Annotation/PluralTranslationTest.php @coversDefaultClass \Drupal\Core\Annotation\PluralTranslation[[api-linebreak]] @group Annotation
PluralVariants class Drupal\config_translation\FormElement core/modules/config_translation/src/FormElement/PluralVariants.php Defines form elements for plurals in configuration translation.
PoDatabaseReader class Drupal\locale core/modules/locale/src/PoDatabaseReader.php Gettext PO reader working with the locale module database. 1
PoDatabaseWriter class Drupal\locale core/modules/locale/src/PoDatabaseWriter.php Gettext PO writer working with the locale module database.
PoHeader class Drupal\Component\Gettext core/lib/Drupal/Component/Gettext/PoHeader.php Gettext PO header handler. 5
PoHeaderTest class Drupal\Tests\Component\Gettext core/tests/Drupal/Tests/Component/Gettext/PoHeaderTest.php Unit tests for the Gettext PO file header handling features.
PoItem class Drupal\Component\Gettext core/lib/Drupal/Component/Gettext/PoItem.php PoItem handles one translation. 16
PoMemoryWriter class Drupal\Component\Gettext core/lib/Drupal/Component/Gettext/PoMemoryWriter.php Defines a Gettext PO memory writer, to be used by the installer. 1
PoMetadataInterface interface Drupal\Component\Gettext core/lib/Drupal/Component/Gettext/PoMetadataInterface.php Methods required for both reader and writer implementations. 2
PoReaderInterface interface Drupal\Component\Gettext core/lib/Drupal/Component/Gettext/PoReaderInterface.php Shared interface definition for all Gettext PO Readers. 2 2
PositionShimTestController class Drupal\position_shim_test\Controller core/modules/system/tests/modules/position_shim_test/src/Controller/PositionShimTestController.php
PositionShimTestPortedJqueryTestsController class Drupal\position_shim_test\Controller core/modules/system/tests/modules/position_shim_test/src/Controller/PositionShimTestPortedJqueryTestsController.php
PostgresqlDateSql class Drupal\views\Plugin\views\query core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php PostgreSQL-specific date handling. 1 2
PostgresqlDateSqlTest class Drupal\Tests\views\Unit\Plugin\views\query core/modules/views/tests/src/Unit/Plugin/views/query/PostgresqlDateSqlTest.php Tests the PostgreSQL-specific date query handler.
PostgreSqlSequenceUpdateTest class Drupal\Tests\pgsql\Functional\Database core/modules/pgsql/tests/src/Functional/Database/PostgreSqlSequenceUpdateTest.php Tests that any unowned sequences created previously have a table owner.
PostPackageEventListenerInterface interface Drupal\Composer\Plugin\Scaffold composer/Plugin/Scaffold/PostPackageEventListenerInterface.php Interface for post package event listeners. 1
PoStreamInterface interface Drupal\Component\Gettext core/lib/Drupal/Component/Gettext/PoStreamInterface.php Common functions for file/stream based PO readers/writers. 2
PoStreamReader class Drupal\Component\Gettext core/lib/Drupal/Component/Gettext/PoStreamReader.php Implements Gettext PO stream reader. 2

Other projects


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