Classes, traits, and interfaces - main - 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 1529

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
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. 17
PoItemTest class Drupal\Tests\Component\Gettext core/tests/Drupal/Tests/Component/Gettext/PoItemTest.php Tests Drupal\Component\Gettext\PoItem.
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 The position shim test controller.
PositionShimTestPortedJqueryTestsController class Drupal\position_shim_test\Controller core/modules/system/tests/modules/position_shim_test/src/Controller/PositionShimTestPortedJqueryTestsController.php Controller for the testing jQuery UI position shim.
PostApplyEvent final class Drupal\package_manager\Event core/modules/package_manager/src/Event/PostApplyEvent.php Event fired after staged changes are synced to the active directory. 10
PostApplySubscriber class Drupal\updated_module core/modules/package_manager/tests/fixtures/build_test_projects/updated_module/1.1.0/src/PostApplySubscriber.php Writes a file after staged changes are applied to the active directory. 2
PostCreateEvent final class Drupal\package_manager\Event core/modules/package_manager/src/Event/PostCreateEvent.php Event fired after a stage directory has been created. 8
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.
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
PoStreamWriter class Drupal\Component\Gettext core/lib/Drupal/Component/Gettext/PoStreamWriter.php Defines a Gettext PO stream writer. 2
PoStreamWriterTest class Drupal\Tests\Component\Gettext core/tests/Drupal/Tests/Component/Gettext/PoStreamWriterTest.php Tests Drupal\Component\Gettext\PoStreamWriter.
PostRequireEvent final class Drupal\package_manager\Event core/modules/package_manager/src/Event/PostRequireEvent.php Event fired after packages are updated to the stage directory. 8
PoWriterInterface interface Drupal\Component\Gettext core/lib/Drupal/Component/Gettext/PoWriterInterface.php Shared interface definition for all Gettext PO Writers. 3 1
PreApplyEvent final class Drupal\package_manager\Event core/modules/package_manager/src/Event/PreApplyEvent.php Event fired before staged changes are synced to the active directory. 42
PrecedingConstraintAwareValidatorTrait trait Drupal\ckeditor5\Plugin\Validation\Constraint core/modules/ckeditor5/src/Plugin/Validation/Constraint/PrecedingConstraintAwareValidatorTrait.php A constraint may need preceding constraints to not have been violated.
PreconfiguredFieldUiOptionsInterface interface Drupal\Core\Field core/lib/Drupal/Core/Field/PreconfiguredFieldUiOptionsInterface.php Defines an interface for exposing "preconfigured" field definitions. 2 2
PreCreateEvent final class Drupal\package_manager\Event core/modules/package_manager/src/Event/PreCreateEvent.php Event fired before a stage directory is created. 37
PredefinedStatesWorkflowTestType class Drupal\workflow_type_test\Plugin\WorkflowType core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/PredefinedStatesWorkflowTestType.php Test workflow type.
PredefinedWorkflowTypeTest class Drupal\Tests\workflows\Kernel core/modules/workflows/tests/src/Kernel/PredefinedWorkflowTypeTest.php Test a predefined workflow based on something other than configuration.
PreEntityImportEvent final class Drupal\Core\DefaultContent core/lib/Drupal/Core/DefaultContent/PreEntityImportEvent.php Event dispatched before an entity is created during default content import. 1
PreExistingConfigException class Drupal\Core\Config core/lib/Drupal/Core/Config/PreExistingConfigException.php An exception thrown if configuration with the same name already exists. 7
PreExportEvent final class Drupal\Core\DefaultContent core/lib/Drupal/Core/DefaultContent/PreExportEvent.php Event dispatched before an entity is exported as default content. 7
PrefetchedResult class Drupal\Core\Database\Statement core/lib/Drupal/Core/Database/Statement/PrefetchedResult.php Class for prefetched results of a data query language (DQL) statement. 1
PrefixFloodInterface interface Drupal\Core\Flood core/lib/Drupal/Core/Flood/PrefixFloodInterface.php Defines an interface for flood controllers that clear by identifier prefix. 2 1
PrefixInfoTest class Drupal\Tests\mysqli\Kernel\mysqli core/modules/mysqli/tests/src/Kernel/mysqli/PrefixInfoTest.php Tests that the prefix info for a database schema is correct.
PrefixInfoTest class Drupal\Tests\mysql\Kernel\mysql core/modules/mysql/tests/src/Kernel/mysql/PrefixInfoTest.php Tests that the prefix info for a database schema is correct. 1 1
PreImportEvent final class Drupal\Core\DefaultContent core/lib/Drupal/Core/DefaultContent/PreImportEvent.php Event dispatched before default content is imported. 1
PreloadableRouteProviderInterface interface Drupal\Core\Routing core/lib/Drupal/Core/Routing/PreloadableRouteProviderInterface.php Extends the router provider interface to pre-load routes. 3 3
PrepareCallbackTestForm class Drupal\Tests\Core\Form core/tests/Drupal/Tests/Core/Form/FormStateTest.php A test form used for the prepareCallback() tests.
PrepareLayout class Drupal\layout_builder\EventSubscriber core/modules/layout_builder/src/EventSubscriber/PrepareLayout.php An event subscriber to prepare section storage. 2
PrepareLayoutEvent class Drupal\layout_builder\Event core/modules/layout_builder/src/Event/PrepareLayoutEvent.php Event fired in #pre_render of \Drupal\layout_builder\Element\LayoutBuilder. 3
PrepareModulesEntityUninstallForm class Drupal\system\Form core/modules/system/src/Form/PrepareModulesEntityUninstallForm.php Provides a form removing module content entities data before uninstallation. 1
PrepareModulesEntityUninstallFormTest class Drupal\Tests\system\Kernel\Module core/modules/system/tests/src/Kernel/Module/PrepareModulesEntityUninstallFormTest.php Tests PrepareModulesEntityUninstallForm.
PrepareUninstallTest class Drupal\Tests\system\Functional\Module core/modules/system/tests/src/Functional/Module/PrepareUninstallTest.php Tests that modules which provide entity types can be uninstalled.
PrependCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/PrependCommand.php AJAX command for calling the jQuery insert() method. 6
PreprocessHooks final class Drupal\admin\Hook core/themes/admin/src/Hook/PreprocessHooks.php Provides preprocess implementations.
PreprocessHooks final class Drupal\default_admin\Hook core/themes/default_admin/src/Hook/PreprocessHooks.php Provides preprocess implementations.
PreprocessPagerTest class Drupal\Tests\system\Unit\Pager core/modules/system/tests/src/Unit/Pager/PreprocessPagerTest.php Tests pager preprocessing.
PrerenderList abstract class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/PrerenderList.php Field handler to provide a list of items. 3 3

Other projects


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