Classes, traits, and interfaces - 10.3.x - drupal
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 |
---|---|---|---|---|---|---|---|---|
PhpUnitBridgeTest | class | Drupal\KernelTests\Core\Test | core/ |
Test how kernel tests interact with deprecation errors. | ||||
PhpUnitCliTest | class | Drupal\Tests\Core\Test | core/ |
@group TestSuites @group Test | ||||
PhpUnitTestDummyClass | class | Drupal\phpunit_test | core/ |
|||||
PhpUnitTestRunner | class | Drupal\Core\Test | core/ |
Run PHPUnit-based tests. | 2 | |||
PhpUnitTestRunnerTest | class | Drupal\Tests\Core\Test | core/ |
@coversDefaultClass \Drupal\Core\Test\PhpUnitTestRunner[[api-linebreak]] @group Test | ||||
PhpUnitWarnings | trait | Drupal\Tests\Traits | core/ |
Converts deprecation warnings added by PHPUnit to silenced deprecations. | 12 | |||
PhpUnitWarningsTest | class | Drupal\Tests | core/ |
@coversDefaultClass \Drupal\Tests\Traits\PhpUnitWarnings[[api-linebreak]] @group legacy | ||||
PirateDayCacheabilityMetadataConfigOverride | class | Drupal\config_override_test | core/ |
Test implementation of a config override that provides cacheability metadata. | 2 | |||
PirateDayCacheContext | class | Drupal\config_override_test\Cache | core/ |
Defines the PirateDayCacheContext service that allows to cache the booty. | 2 | 2 | ||
PlaceholderGenerator | class | Drupal\Core\Render | core/ |
Turns a render array into a placeholder. | 1 | 2 | ||
PlaceholderGeneratorInterface | interface | Drupal\Core\Render | core/ |
Defines an interface for turning a render array into a placeholder. | 1 | 1 | ||
PlaceholderGeneratorTest | class | Drupal\Tests\Core\Render | core/ |
@coversDefaultClass \Drupal\Core\Render\PlaceholderGenerator[[api-linebreak]] @group Render | ||||
PlaceholderingRenderCache | class | Drupal\Core\Render | core/ |
Adds automatic placeholdering to the RenderCache. | 1 | 2 | 2 | |
PlaceholderInterface | interface | Drupal\Core\Database\Query | core/ |
Interface for a query that accepts placeholders. | 3 | 2 | ||
PlaceholderMessageTest | class | Drupal\Tests\system\Functional\Render | core/ |
Functional test verifying that messages set in placeholders always appear. | ||||
PlaceholdersTest | class | Drupal\Tests\Core\Render | core/ |
|||||
PlaceholderStrategyInterface | interface | Drupal\Core\Render\Placeholder | core/ |
Provides an interface for defining a placeholder strategy service. | 3 | 2 | ||
PlainTextOutput | class | Drupal\Component\Render | core/ |
Provides an output strategy for transforming HTML into simple plain text. | 20 | |||
PlainTextOutputTest | class | Drupal\Tests\Component\Render | core/ |
@coversDefaultClass \Drupal\Component\Render\PlainTextOutput[[api-linebreak]] @group Utility | ||||
Plugin | class | Drupal\Component\Annotation | core/ |
Defines a Plugin annotation object. | 42 | 41 | ||
Plugin | class | Drupal\Component\Plugin\Attribute | core/ |
Defines a Plugin attribute object. | 52 | 55 | ||
Plugin | class | Drupal\Composer\Plugin\Scaffold | composer/ |
Composer plugin for handling drupal scaffold. | ||||
PluginAlterTest | class | Drupal\KernelTests\Core\Render\Element | core/ |
@group Render | ||||
PluginAwareInterface | interface | Drupal\Component\Plugin | core/ |
Provides an interface for objects that depend on a plugin. | 4 | 6 | ||
PluginBase | abstract class | Drupal\Core\Plugin | core/ |
Base class for plugins supporting metadata inspection and translation. | 47 | 45 | ||
PluginBase | abstract class | Drupal\Component\Plugin | core/ |
Base class for plugins wishing to support metadata inspection. | 14 | 28 | ||
PluginBase | abstract class | Drupal\views\Plugin\views | core/ |
Base class for any views plugin types. | 15 | 20 | ||
PluginBaseTest | class | Drupal\Tests\Component\Plugin | core/ |
@coversDefaultClass \Drupal\Component\Plugin\PluginBase[[api-linebreak]] @group Plugin | ||||
PluginBaseTest | class | Drupal\Tests\views\Unit | core/ |
@coversDefaultClass \Drupal\views\Plugin\views\PluginBase[[api-linebreak]] @group views | ||||
PluginBaseTest | class | Drupal\Tests\views\Kernel\Plugin | core/ |
Tests the PluginBase class. | ||||
PluginDefinition | class | Drupal\Component\Plugin\Definition | core/ |
Provides object-based plugin definitions. | 9 | 9 | ||
PluginDefinitionInterface | interface | Drupal\Component\Plugin\Definition | core/ |
Defines a plugin definition. | 6 | 8 | ||
PluginDependencyTrait | trait | Drupal\Core\Plugin | core/ |
Provides a trait for calculating the dependencies of a plugin. | 5 | |||
PluginDependencyTraitTest | class | Drupal\Tests\Core\Plugin | core/ |
@coversDefaultClass \Drupal\Core\Plugin\PluginDependencyTrait[[api-linebreak]] @group Plugin | ||||
PluginEventSubscriber | class | Drupal\migrate\Plugin | core/ |
Event subscriber to forward Migrate events to source and destination plugins. | 2 | |||
PluginExample | class | Drupal\plugin_test\Plugin\Attribute | core/ |
Defines a custom PluginExample attribute. | 2 | |||
PluginExample | class | Drupal\plugin_test\Plugin\Annotation | core/ |
Defines a custom Plugin annotation. | 1 | |||
PluginException | class | Drupal\Component\Plugin\Exception | core/ |
Base class for plugin exceptions. | 3 | 24 | ||
PluginExistsConstraint | class | Drupal\Core\Plugin\Plugin\Validation\Constraint | core/ |
Checks if a plugin exists and optionally implements a particular interface. | 1 | |||
PluginExistsConstraintTest | class | Drupal\Tests\Core\Plugin | core/ |
@group Plugin @group Validation | ||||
PluginExistsConstraintValidator | class | Drupal\Core\Plugin\Plugin\Validation\Constraint | core/ |
Validates the PluginExists constraint. | ||||
PluginExistsConstraintValidatorTest | class | Drupal\KernelTests\Core\Plugin | core/ |
@group Plugin @group Validation | ||||
PluginExtended | class | Drupal\plugin_test_extended\Plugin\Annotation | core/ |
Defines a test annotation that extends an annotation in another namespace. | ||||
PluginFormBase | abstract class | Drupal\Core\Plugin | core/ |
Provides a base class for plugin forms. | 4 | 4 | ||
PluginFormFactory | class | Drupal\Core\Plugin | core/ |
Provides form discovery capabilities for plugins. | 1 | 2 | ||
PluginFormFactoryInterface | interface | Drupal\Core\Plugin | core/ |
Provides an interface for retrieving form objects for plugins. | 1 | 9 | ||
PluginFormFactoryTest | class | Drupal\Tests\Core\Plugin | core/ |
@coversDefaultClass \Drupal\Core\Plugin\PluginFormFactory[[api-linebreak]] @group Plugin | ||||
PluginFormInterface | interface | Drupal\Core\Plugin | core/ |
Provides an interface for an embeddable plugin form. | 21 | 27 | ||
PluginHelper | in drupal:10.1.0 and is removed from drupal:11.0.0. Instead, use instanceof() to check for \Drupal\Component\Plugin\ConfigurableInterface. |
class | Drupal\Component\Plugin | core/ |
A helper class to determine if a plugin is configurable. | 1 | ||
PluginHelperLegacyTest | class | Drupal\Tests\Component\Plugin | core/ |
@coversDefaultClass \Drupal\Component\Plugin\PluginHelper[[api-linebreak]] @group Plugin @group legacy |
Pagination
- Previous page
- Page 138
- Next page
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.