Classes, traits, and interfaces - 8.9.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 1511

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
LibraryDiscoveryIntegrationTest class Drupal\KernelTests\Core\Asset core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php Tests the library discovery and library discovery parser.
LibraryDiscoveryInterface interface Drupal\Core\Asset core/lib/Drupal/Core/Asset/LibraryDiscoveryInterface.php Discovers information for asset (CSS/JavaScript) libraries. 1
LibraryDiscoveryParser class Drupal\Core\Asset core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php Parses library files to get extension data. 1 1 2
LibraryDiscoveryParserTest class Drupal\Tests\Core\Asset core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php @coversDefaultClass \Drupal\Core\Asset\LibraryDiscoveryParser @group Asset
LibraryDiscoveryTest class Drupal\Tests\Core\Asset core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php @coversDefaultClass \Drupal\Core\Asset\LibraryDiscovery @group Asset
LimitOperatorsDefaultsTest class Drupal\Tests\views\Functional\Update core/modules/views/tests/src/Functional/Update/LimitOperatorsDefaultsTest.php Tests the upgrade path for limit operators feature.
Link final class Drupal\jsonapi\JsonApiResource core/modules/jsonapi/src/JsonApiResource/Link.php Represents an RFC8288 based link. 6
Link class Drupal\Core core/lib/Drupal/Core/Link.php Defines an object that holds information about a link. 93
Link class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Link.php Provides a link render element. 2 4
LinkAccessConstraint class Drupal\link\Plugin\Validation\Constraint core/modules/link/src/Plugin/Validation/Constraint/LinkAccessConstraint.php Defines an access validation constraint for links. 1
LinkAccessConstraintValidator class Drupal\link\Plugin\Validation\Constraint core/modules/link/src/Plugin/Validation/Constraint/LinkAccessConstraintValidator.php Validates the LinkAccess constraint. 1
LinkAccessConstraintValidatorTest class Drupal\Tests\link\Unit\Plugin\Validation\Constraint core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkAccessConstraintValidatorTest.php Tests the LinkAccessConstraintValidator validator.
LinkApprove class Drupal\comment\Plugin\views\field core/modules/comment/src/Plugin/views/field/LinkApprove.php Provides a comment approve link.
LinkBase abstract class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/LinkBase.php Field handler to present a link to an entity. 5 4
LinkCckDeprecationTest class Drupal\Tests\link\Kernel\Plugin\migrate\cckfield\d7 core/modules/link/tests/src/Kernel/Plugin/migrate/cckfield/d7/LinkCckDeprecationTest.php @group link @group legacy
LinkCckTest class Drupal\Tests\link\Unit\Plugin\migrate\cckfield core/modules/link/tests/src/Unit/Plugin/migrate/cckfield/LinkCckTest.php @coversDefaultClass \Drupal\link\Plugin\migrate\cckfield\LinkField @group link @group legacy
LinkCckTest class Drupal\Tests\link\Kernel\Plugin\migrate\cckfield\d7 core/modules/link/tests/src/Kernel/Plugin/migrate/cckfield/d7/LinkCckTest.php @coversDefaultClass \Drupal\link\Plugin\migrate\cckfield\d7\LinkField @group link @group legacy 1
LinkCollection final class Drupal\jsonapi\JsonApiResource core/modules/jsonapi/src/JsonApiResource/LinkCollection.php Contains a set of JSON:API Link objects. 7
LinkCollectionNormalizer class Drupal\jsonapi\Normalizer core/modules/jsonapi/src/Normalizer/LinkCollectionNormalizer.php Normalizes a LinkCollection object. 2
LinkExternalProtocolsConstraint class Drupal\link\Plugin\Validation\Constraint core/modules/link/src/Plugin/Validation/Constraint/LinkExternalProtocolsConstraint.php Defines a protocol validation constraint for links to external URLs. 1
LinkExternalProtocolsConstraintValidator class Drupal\link\Plugin\Validation\Constraint core/modules/link/src/Plugin/Validation/Constraint/LinkExternalProtocolsConstraintValidator.php Validates the LinkExternalProtocols constraint. 1
LinkExternalProtocolsConstraintValidatorTest class Drupal\Tests\link\Unit\Plugin\Validation\Constraint core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkExternalProtocolsConstraintValidatorTest.php @coversDefaultClass \Drupal\link\Plugin\Validation\Constraint\LinkExternalProtocolsConstraintValidator @group Link
LinkField class Drupal\link\Plugin\migrate\field\d6 core/modules/link/src/Plugin/migrate/field/d6/LinkField.php Plugin annotation @MigrateField( id = "link", core = {6}, type_map = { "link" = "link", }, source_module = "link", destination_module = "link" ) 1 2
LinkField class Drupal\link\Plugin\migrate\field\d7 core/modules/link/src/Plugin/migrate/field/d7/LinkField.php @MigrateField( id = "link_field", core = {7}, type_map = { "link_field" = "link" }, source_module = "link", destination_module = "link" ) 1
LinkField

in drupal:8.3.0 and is removed from drupal:9.0.0. Use \Drupal\link\Plugin\migrate\field\d6\LinkField instead.

class Drupal\link\Plugin\migrate\cckfield core/modules/link/src/Plugin/migrate/cckfield/LinkField.php Plugin annotation @MigrateCckField( id = "link", core = {6}, type_map = { "link_field" = "link" }, source_module = "link", destination_module = "link" ) 1 2
LinkField

in drupal:8.3.0 and is removed from drupal:9.0.0. Use \Drupal\link\Plugin\migrate\field\d7\LinkField instead.

class Drupal\link\Plugin\migrate\cckfield\d7 core/modules/link/src/Plugin/migrate/cckfield/d7/LinkField.php @MigrateCckField( id = "link_field", core = {7}, type_map = { "link_field" = "link" }, source_module = "link", destination_module = "link" ) 1
LinkFieldLegacyTest class Drupal\Tests\link\Unit\Plugin\migrate\field\d6 core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldLegacyTest.php @group legacy @group link
LinkFieldLegacyTest class Drupal\Tests\link\Kernel\Plugin\migrate\field\d7 core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldLegacyTest.php @group legacy @group link
LinkFieldRdfaTest class Drupal\Tests\rdf\Kernel\Field core/modules/rdf/tests/src/Kernel/Field/LinkFieldRdfaTest.php Tests the placement of RDFa in link field formatters.
LinkFieldTest class Drupal\Tests\link\Unit\Plugin\migrate\field\d6 core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldTest.php @coversDefaultClass \Drupal\link\Plugin\migrate\field\d6\LinkField @group link 1
LinkFieldTest class Drupal\Tests\link\Kernel\Plugin\migrate\field\d7 core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldTest.php @coversDefaultClass \Drupal\link\Plugin\migrate\field\d7\LinkField @group link 1
LinkFieldTest class Drupal\Tests\link\Functional core/modules/link/tests/src/Functional/LinkFieldTest.php Tests link field widgets and formatters.
LinkFieldUITest class Drupal\Tests\link\Functional core/modules/link/tests/src/Functional/LinkFieldUITest.php Tests link field UI functionality.
LinkFormatter class Drupal\link\Plugin\Field\FieldFormatter core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php Plugin implementation of the 'link' formatter. 1
LinkGenerationTest class Drupal\KernelTests\Core\Url core/tests/Drupal/KernelTests/Core/Url/LinkGenerationTest.php Tests link generation with hooks.
LinkGenerator class Drupal\Core\Utility core/lib/Drupal/Core/Utility/LinkGenerator.php Provides a class which generates a link with route names and parameters. 2 2
LinkGeneratorInterface interface Drupal\Core\Utility core/lib/Drupal/Core/Utility/LinkGeneratorInterface.php Defines an interface for generating links from route names and parameters. 1 6
LinkGeneratorTest class Drupal\Tests\Core\Utility core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php @coversDefaultClass \Drupal\Core\Utility\LinkGenerator @group Utility
LinkGeneratorTrait

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Link instead.

trait Drupal\Core\Routing core/lib/Drupal/Core/Routing/LinkGeneratorTrait.php Wrapper methods for the Link Generator. 2
LinkItem class Drupal\link\Plugin\Field\FieldType core/modules/link/src/Plugin/Field/FieldType/LinkItem.php Plugin implementation of the 'link' field type.
LinkItemInterface interface Drupal\link core/modules/link/src/LinkItemInterface.php Defines an interface for the link field item. 1 13
LinkItemSerializationTest class Drupal\Tests\link\Kernel core/modules/link/tests/src/Kernel/LinkItemSerializationTest.php Tests link field serialization.
LinkItemTest class Drupal\Tests\link\Kernel core/modules/link/tests/src/Kernel/LinkItemTest.php Tests the new entity API for the link field type.
LinkManager

in drupal:8.3.0 and is removed from drupal:9.0.0. This has been moved to the hal module. This exists solely for BC.

class Drupal\rest\LinkManager core/modules/rest/src/LinkManager/LinkManager.php 1
LinkManager class Drupal\hal\LinkManager core/modules/hal/src/LinkManager/LinkManager.php 1 1 2
LinkManagerBase abstract class Drupal\hal\LinkManager core/modules/hal/src/LinkManager/LinkManagerBase.php Defines an abstract base-class for HAL link manager objects. 3 1
LinkManagerBase

in drupal:8.3.0 and is removed from drupal:9.0.0. This has been moved to the hal module. This exists solely for BC.

abstract class Drupal\rest\LinkManager core/modules/rest/src/LinkManager/LinkManagerBase.php
LinkManagerInterface

in drupal:8.3.0 and is removed from drupal:9.0.0. This has been moved to the hal module. This exists solely for BC.

interface Drupal\rest\LinkManager core/modules/rest/src/LinkManager/LinkManagerInterface.php 1
LinkManagerInterface interface Drupal\hal\LinkManager core/modules/hal/src/LinkManager/LinkManagerInterface.php Interface implemented by link managers. 2 4
LinkNotExistingInternalConstraint class Drupal\link\Plugin\Validation\Constraint core/modules/link/src/Plugin/Validation/Constraint/LinkNotExistingInternalConstraint.php Defines a protocol validation constraint for links to broken internal URLs. 1

Other projects


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