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
TranslationLink class Drupal\content_translation\Plugin\views\field core/modules/content_translation/src/Plugin/views/field/TranslationLink.php Provides a translation link for an entity.
TranslationLinkTest class Drupal\Tests\content_translation\Functional\Views core/modules/content_translation/tests/src/Functional/Views/TranslationLinkTest.php Tests the content translation overview link field handler.
TranslationManager class Drupal\Core\StringTranslation core/lib/Drupal/Core/StringTranslation/TranslationManager.php Defines a chained translation implementation combining multiple translators. 2 7 2
TranslationManager class Drupal\locale core/modules/locale/src/TranslationManager.php Plural index implementation.
TranslationManagerTest class Drupal\Tests\Core\StringTranslation core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php Tests Drupal\Core\StringTranslation\TranslationManager.
TranslationsStream class Drupal\locale\StreamWrapper core/modules/locale/src/StreamWrapper/TranslationsStream.php Defines a Drupal translations (translations://) stream wrapper class. 4 2
TranslationStatusForm class Drupal\locale\Form core/modules/locale/src/Form/TranslationStatusForm.php Provides a translation status form. 1
TranslationStatusInterface interface Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/TranslationStatusInterface.php Defines an interface for checking the status of an entity translation. 1 3
TranslationsTest class Drupal\Tests\media_library\FunctionalJavascript core/modules/media_library/tests/src/FunctionalJavascript/TranslationsTest.php Tests media library for translatable media.
TranslationString class Drupal\locale core/modules/locale/src/TranslationString.php Defines the locale translation string object. 1
TranslationStringTest class Drupal\KernelTests\Core\StringTranslation core/tests/Drupal/KernelTests/Core/StringTranslation/TranslationStringTest.php Tests the TranslatableMarkup class.
TranslationTest class Drupal\Tests\Core\Annotation core/tests/Drupal/Tests/Core/Annotation/TranslationTest.php Tests Drupal\Core\Annotation\Translation.
TranslationTest class Drupal\Tests\field\Kernel core/modules/field/tests/src/Kernel/TranslationTest.php Tests multilingual fields logic.
TranslationWebTest class Drupal\Tests\field\Functional core/modules/field/tests/src/Functional/TranslationWebTest.php Tests multilingual fields logic that require a full environment.
TranslatorInterface interface Drupal\Core\StringTranslation\Translator core/lib/Drupal/Core/StringTranslation/Translator/TranslatorInterface.php Interface for objects capable of string translation. 3 3
TranslatorInterface interface Drupal\Core\Validation core/lib/Drupal/Core/Validation/TranslatorInterface.php Defines an interface used in validation. 1 1
TransliterationInterface interface Drupal\Component\Transliteration core/lib/Drupal/Component/Transliteration/TransliterationInterface.php Defines an interface for classes providing transliteration. 1 5
TransportInfoController class Drupal\mailer_transport_factory_functional_test\Controller core/modules/mailer/tests/modules/mailer_transport_factory_functional_test/src/Controller/TransportInfoController.php Returns responses for transport info routes.
TransportServiceFactory class Drupal\Core\Mailer core/lib/Drupal/Core/Mailer/TransportServiceFactory.php The default mailer transport service factory. 1
TransportServiceFactoryInterface interface Drupal\Core\Mailer core/lib/Drupal/Core/Mailer/TransportServiceFactoryInterface.php An interface defining mailer transport service factory implementations. 1
TransportServiceFactoryTest class Drupal\Tests\mailer\Functional core/modules/mailer/tests/src/Functional/TransportServiceFactoryTest.php Tests the transport service factory in the child site of browser tests.
TransportServiceFactoryTrait trait Drupal\Core\Mailer core/lib/Drupal/Core/Mailer/TransportServiceFactoryTrait.php A trait containing helper methods for transport service construction.
TransportTest class Drupal\Tests\mailer\Kernel core/modules/mailer/tests/src/Kernel/TransportTest.php Tests the transport factory service.
TraversableObject class Drupal\jsonapi_test_data_type core/modules/jsonapi/tests/modules/jsonapi_test_data_type/src/TraversableObject.php An object which implements \IteratorAggregate. 2
TraversableObjectNormalizer class Drupal\jsonapi_test_data_type\Normalizer core/modules/jsonapi/tests/modules/jsonapi_test_data_type/src/Normalizer/TraversableObjectNormalizer.php Normalizes TraversableObject. 2
TraversableTypedDataInterface interface Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/TraversableTypedDataInterface.php An interface for typed data objects that can be traversed. 3 8
TreeConfigTargetForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/TreeConfigTargetForm.php Provides a form for configuring preferences and dynamically updating select list options via AJAX. 1 1
TRexEditor class Drupal\editor_test\Plugin\Editor core/modules/editor/tests/modules/editor_test/src/Plugin/Editor/TRexEditor.php Defines a Tyrannosaurus-Rex powered text editor for testing purposes.
TriggeringElementProgrammedTest class Drupal\KernelTests\Core\Form core/tests/Drupal/KernelTests/Core/Form/TriggeringElementProgrammedTest.php Tests detection of triggering_element for programmed form submissions.
TriggeringElementTest class Drupal\Tests\system\FunctionalJavascript\Form core/modules/system/tests/src/FunctionalJavascript/Form/TriggeringElementTest.php Tests that FAPI correctly determines the triggering element.
TriggerPreviewCommand class Drupal\views\Ajax core/modules/views/src/Ajax/TriggerPreviewCommand.php Provides an AJAX command for triggering the views live preview. 1
Truncate class Drupal\pgsql\Driver\Database\pgsql core/modules/pgsql/src/Driver/Database/pgsql/Truncate.php PostgreSQL implementation of \Drupal\Core\Database\Query\Truncate.
Truncate class Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses core/tests/fixtures/database_drivers/module/core_fake/src/Driver/Database/CoreFakeWithAllCustomClasses/Truncate.php CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Truncate.
Truncate class Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/Truncate.php General class for an abstracted TRUNCATE operation. 3 5
Truncate class Drupal\sqlite\Driver\Database\sqlite core/modules/sqlite/src/Driver/Database/sqlite/Truncate.php SQLite implementation of \Drupal\Core\Database\Query\Truncate.
TruncateTest class Drupal\Tests\pgsql\Kernel\pgsql core/modules/pgsql/tests/src/Kernel/pgsql/TruncateTest.php Tests the PostgreSQL implementation of truncate queries.
TrustedCallback class Drupal\Core\Security\Attribute core/lib/Drupal/Core/Security/Attribute/TrustedCallback.php Attribute to tell that a method is a trusted callback. 17
TrustedCallbackInterface interface Drupal\Core\Security core/lib/Drupal/Core/Security/TrustedCallbackInterface.php Interface to declare trusted callbacks. 53 53
TrustedHostsRequestFactory class Drupal\Core\Http core/lib/Drupal/Core/Http/TrustedHostsRequestFactory.php Provides a request factory for requests using host verification. 2
TrustedHostsRequestFactoryTest class Drupal\Tests\Core\Http core/tests/Drupal/Tests/Core/Http/TrustedHostsRequestFactoryTest.php Tests the trusted hosts request factory.
TrustedHostsTest class Drupal\Tests\shortcut\Functional core/modules/shortcut/tests/src/Functional/TrustedHostsTest.php Tests output on the status overview page.
TrustedHostsTest class Drupal\Tests\system\Functional\System core/modules/system/tests/src/Functional/System/TrustedHostsTest.php Tests output on the status overview page.
TrustedHostsTestController class Drupal\trusted_hosts_test\Controller core/modules/system/tests/modules/trusted_hosts_test/src/Controller/TrustedHostsTestController.php Provides a test controller for testing the trusted hosts setting.
TrustedInterface interface Drupal\Tests\Core\Security core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php Interface representing classes with trusted callbacks. 1
TrustedMethods class Drupal\Tests\Core\Security core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php Test class with implemented trusted callbacks.
TrustedObject class Drupal\Tests\Core\Security core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php Class with a trusted interface implementation with callback.
TrustedRedirectResponse class Drupal\Core\Routing core/lib/Drupal/Core/Routing/TrustedRedirectResponse.php Provides a redirect response which contains trusted URLs. 6
TrustedRedirectResponseTest class Drupal\Tests\Core\Routing core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php Tests Drupal\Core\Routing\TrustedRedirectResponse.
TurtleLazyBuilder class Drupal\Tests\big_pipe\Unit\Render core/modules/big_pipe/tests/src/Unit/Render/FiberPlaceholderTest.php Test class for testing fiber placeholders.
TwigAllowed final class Drupal\Core\Template\Attribute core/lib/Drupal/Core/Template/Attribute/TwigAllowed.php Allow twig access to methods. 2

Other projects


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