Classes, traits, and interfaces - 9.5.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 1523

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
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\mysql\Driver\Database\mysql core/modules/mysql/src/Driver/Database/mysql/Truncate.php MySQL implementation of \Drupal\Core\Database\Query\Truncate. 2 2
Truncate class Drupal\sqlite\Driver\Database\sqlite core/modules/sqlite/src/Driver/Database/sqlite/Truncate.php SQLite implementation of \Drupal\Core\Database\Query\Truncate. 1 1
Truncate class Drupal\driver_test\Driver\Database\DrivertestMysqlDeprecatedVersion core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysqlDeprecatedVersion/Truncate.php MySQL test implementation of \Drupal\Core\Database\Query\Truncate.
Truncate class Drupal\driver_test\Driver\Database\DrivertestPgsql core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Truncate.php PostgreSQL implementation of \Drupal\Core\Database\Query\Truncate.
Truncate class Drupal\pgsql\Driver\Database\pgsql core/modules/pgsql/src/Driver/Database/pgsql/Truncate.php PostgreSQL implementation of \Drupal\Core\Database\Query\Truncate. 2 2
Truncate class Drupal\driver_test\Driver\Database\DrivertestMysql core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Truncate.php MySQL test implementation of \Drupal\Core\Database\Query\Truncate.
Truncate class Drupal\corefake\Driver\Database\corefakeWithAllCustomClasses core/tests/fixtures/database_drivers/module/corefake/src/Driver/Database/corefakeWithAllCustomClasses/Truncate.php CorefakeWithAllCustomClasses implementation of \Drupal\Core\Database\Truncate.
Truncate

in drupal:9.4.0 and is removed from drupal:11.0.0. The SQLite database driver has been moved to the sqlite module.

class Drupal\Core\Database\Driver\sqlite core/lib/Drupal/Core/Database/Driver/sqlite/Truncate.php SQLite implementation of \Drupal\Core\Database\Query\Truncate. 1
Truncate

in drupal:9.4.0 and is removed from drupal:11.0.0. The PostgreSQL database driver has been moved to the pgsql module.

class Drupal\Core\Database\Driver\pgsql core/lib/Drupal/Core/Database/Driver/pgsql/Truncate.php PostgreSQL implementation of \Drupal\Core\Database\Query\Truncate. 1
Truncate class Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/Truncate.php General class for an abstracted TRUNCATE operation. 4 5
TrustedCallbackInterface interface Drupal\Core\Security core/lib/Drupal/Core/Security/TrustedCallbackInterface.php Interface to declare trusted callbacks. 39 41
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\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 1
TrustedMethods class Drupal\Tests\Core\Security core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php
TrustedObject class Drupal\Tests\Core\Security core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php
TrustedRedirectResponse class Drupal\Core\Routing core/lib/Drupal/Core/Routing/TrustedRedirectResponse.php Provides a redirect response which contains trusted URLs. 4
TrustedRedirectResponseTest class Drupal\Tests\Core\Routing core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php @coversDefaultClass \Drupal\Core\Routing\TrustedRedirectResponse[[api-linebreak]] @group Routing
TwigDebugMarkupTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/TwigDebugMarkupTest.php Tests for Twig debug markup.
TwigEnvironment class Drupal\Core\Template core/lib/Drupal/Core/Template/TwigEnvironment.php A class that defines a Twig environment for Drupal. 3 2
TwigEnvironmentTest class Drupal\KernelTests\Core\Theme core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php Tests the twig environment.
TwigEnvironmentTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/TwigEnvironmentTest.php Tests Twig environment.
TwigExtension class Drupal\Core\Template core/lib/Drupal/Core/Template/TwigExtension.php A class providing Drupal Twig extensions. 1 2
TwigExtensionPass class Drupal\Core\DependencyInjection\Compiler core/lib/Drupal/Core/DependencyInjection/Compiler/TwigExtensionPass.php Adds the twig_extension_hash parameter to the container. 1
TwigExtensionTest class Drupal\Tests\Core\Template core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php Tests the twig extension.
TwigExtensionTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php Tests Twig extensions.
TwigExtensionTestController class Drupal\twig_extension_test core/modules/system/tests/modules/twig_extension_test/src/TwigExtensionTestController.php Controller routines for Twig extension test routes.
TwigExtensionTestString class Drupal\Tests\Core\Template core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php
TwigFilterTest class Drupal\Tests\system\Kernel\Theme core/modules/system/tests/src/Kernel/Theme/TwigFilterTest.php Tests Drupal's Twig filters.
TwigIncludeTest class Drupal\Tests\system\Kernel\Theme core/modules/system/tests/src/Kernel/Theme/TwigIncludeTest.php Tests including files in Twig templates.
TwigLoaderTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/TwigLoaderTest.php Tests adding Twig loaders.
TwigMarkupInterfaceTest class Drupal\KernelTests\Core\Theme core/tests/Drupal/KernelTests/Core/Theme/TwigMarkupInterfaceTest.php Tests Twig with MarkupInterface objects.
TwigNamespaceTest class Drupal\Tests\system\Kernel\Theme core/modules/system/tests/src/Kernel/Theme/TwigNamespaceTest.php Tests Twig namespaces.
TwigNodeTrans class Drupal\Core\Template core/lib/Drupal/Core/Template/TwigNodeTrans.php A class that defines the Twig 'trans' tag for Drupal. 1
TwigNodeVisitor class Drupal\Core\Template core/lib/Drupal/Core/Template/TwigNodeVisitor.php Provides a TwigNodeVisitor to change the generated parse-tree.
TwigPhpStorageCache class Drupal\Core\Template core/lib/Drupal/Core/Template/TwigPhpStorageCache.php Provides an alternate cache storage for Twig using PhpStorage. 1
TwigRawTest class Drupal\Tests\system\Kernel\Theme core/modules/system/tests/src/Kernel/Theme/TwigRawTest.php Tests Twig 'raw' filter.
TwigRegistryLoaderTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/TwigRegistryLoaderTest.php Tests Twig registry loader.
TwigSandboxPolicy class Drupal\Core\Template core/lib/Drupal/Core/Template/TwigSandboxPolicy.php Default sandbox policy for Twig templates. 1
TwigSandboxTest class Drupal\Tests\Core\Template core/tests/Drupal/Tests/Core/Template/TwigSandboxTest.php Tests the twig sandbox policy.
TwigSettingsTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/TwigSettingsTest.php Tests overriding Twig engine settings via settings.php.
TwigThemeTestController class Drupal\twig_theme_test core/modules/system/tests/modules/twig_theme_test/src/TwigThemeTestController.php Controller routines for Twig theme test routes.
TwigTransTest class Drupal\Tests\system\Functional\Theme core/modules/system/tests/src/Functional/Theme/TwigTransTest.php Tests Twig "trans" tags.
TwigTransTokenParser class Drupal\Core\Template core/lib/Drupal/Core/Template/TwigTransTokenParser.php A class that defines the Twig 'trans' token parser for Drupal.
TwigWhiteListTest class Drupal\KernelTests\Core\Theme core/tests/Drupal/KernelTests/Core/Theme/TwigWhiteListTest.php Tests white-listing of entity properties.

Other projects


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