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
FormTestRebuildPreserveValuesForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestRebuildPreserveValuesForm.php Form builder for testing preservation of values during a rebuild. 1
FormTestRecipeInputForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestRecipeInputForm.php Form to test recipe input functionality. 1
FormTestRedirectForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestRedirectForm.php Form builder to detect form redirect. 1
FormTestRequiredAttributeForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestRequiredAttributeForm.php Builds a form to test the required attribute. 1
FormTestResponseForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestResponseForm.php Form constructor for testing #type 'url' elements. 1
FormTestSelectForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestSelectForm.php Builds a form to test #type 'select' validation. 1
FormTestServiceObject class Drupal\form_test core/modules/system/tests/modules/form_test/src/FormTestServiceObject.php Provides a test form object. 2
FormTestStatePersistForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestStatePersistForm.php Form constructor for testing form state persistence. 1
FormTestStorageForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestStorageForm.php A multistep form for testing the form storage. 1
FormTestStoragePageCacheForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestStoragePageCacheForm.php Form to test page cache storage. 1
FormTestSubmitButtonAttributeForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestSubmitButtonAttributeForm.php Builds a simple form to test the submit_button attribute. 1
FormTestTableForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestTableForm.php Form constructor for testing #type 'table' elements.
FormTestTableSelectColspanForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectColspanForm.php Builds a form to test table selects with different column spans. 1
FormTestTableSelectDisabledRowsForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectDisabledRowsForm.php Builds a form to test table select with disabled rows. 1
FormTestTableSelectEmptyForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectEmptyForm.php Builds a form to test table select with '#options' set to empty. 1
FormTestTableSelectFormBase abstract class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectFormBase.php Provides a base class for tableselect forms. 7
FormTestTableSelectJsSelectForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectJsSelectForm.php Builds a form to test table select with JS. 1
FormTestTableSelectMultipleFalseForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectMultipleFalseForm.php Builds a form to test table select with '#multiple" set to FALSE. 1
FormTestTableSelectMultipleTrueForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectMultipleTrueForm.php Builds a form to test table select with '#multiple' as TRUE. 1
FormTestTextareaForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestTextareaForm.php Form for testing textarea. 1
FormTestUrlForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestUrlForm.php Form constructor for testing #type 'url' elements. 1
FormTestValidateForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestValidateForm.php Form builder for testing \Drupal\Core\Form\FormValidatorInterface::validateForm(). 1
FormTestValidateNoToken class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestValidateNoToken.php Form to test the validation of forms with a disabled CSRF token. 1
FormTestValidateRequiredForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestValidateRequiredForm.php Form constructor to test the #required property. 1
FormTestValidateRequiredNoTitleForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestValidateRequiredNoTitleForm.php Form constructor to test the #required property without #title. 1
FormTestVerticalTabsAccessForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestVerticalTabsAccessForm.php Builds a form to test vertical tabs access. 1
FormTestVerticalTabsForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestVerticalTabsForm.php Builds a simple form to test vertical tabs. 1
FormTestVerticalTabsWithSummaryForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/FormTestVerticalTabsWithSummaryForm.php Builds a simple form to test vertical-tabs form element with tab summaries. 1
Formula class Drupal\views\Plugin\views\argument core/modules/views/src/Plugin/views/argument/Formula.php Argument handler for simple formulae. 1
FormUploadedFile class Drupal\file\Upload core/modules/file/src/Upload/FormUploadedFile.php Provides a bridge to Symfony UploadedFile. 2
FormValidationMessageOrderTest class Drupal\KernelTests\Core\Form core/tests/Drupal/KernelTests/Core/Form/FormValidationMessageOrderTest.php Tests form validation messages are displayed in the same order as the fields.
FormValidator class Drupal\Core\Form core/lib/Drupal/Core/Form/FormValidator.php Provides validation of form submissions. 2 2
FormValidatorInterface interface Drupal\Core\Form core/lib/Drupal/Core/Form/FormValidatorInterface.php Provides an interface for validating form submissions. 2
FormValidatorTest class Drupal\Tests\Core\Form core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php Tests Drupal\Core\Form\FormValidator.
FormValidatorTestMockInterface interface Drupal\Tests\Core\Form core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php Interface used in the mocking process of this test.
FormValuesTest class Drupal\FunctionalJavascriptTests\Ajax core/tests/Drupal/FunctionalJavascriptTests/Ajax/FormValuesTest.php Tests that form values are properly delivered to AJAX callbacks.
FrameworkTest class Drupal\Tests\system\Functional\Ajax core/modules/system/tests/src/Functional/Ajax/FrameworkTest.php Performs tests on AJAX framework functions.
FrameworkTest class Drupal\Tests\system\FunctionalJavascript core/modules/system/tests/src/FunctionalJavascript/FrameworkTest.php Tests the off-canvas dialog functionality.
FriendsNotATestClass class Drupal\Tests\Core\Foo core/tests/PHPStan/fixtures/test-methods-with-metadata.php
FriendsTest class Drupal\Tests\Core\Foo core/tests/PHPStan/fixtures/test-methods-with-metadata.php 1
FriendsTrait trait Drupal\Tests\Core\Foo core/tests/PHPStan/fixtures/test-methods-with-metadata.php
FriendsWithFriendsTraitTest class Drupal\Tests\Core\Foo core/tests/PHPStan/fixtures/test-methods-with-metadata.php
FrontMatter class Drupal\Component\FrontMatter core/lib/Drupal/Component/FrontMatter/FrontMatter.php Component for parsing front matter from a source. 6
FrontMatterParseException class Drupal\Component\FrontMatter\Exception core/lib/Drupal/Component/FrontMatter/Exception/FrontMatterParseException.php Defines a class for front matter parsing exceptions. 3
FrontMatterTest class Drupal\KernelTests\Core\Theme core/tests/Drupal/KernelTests/Core/Theme/FrontMatterTest.php Tests Twig front matter support.
FrontMatterTest class Drupal\Tests\Component\FrontMatter core/tests/Drupal/Tests/Component/FrontMatter/FrontMatterTest.php Tests front matter parsing helper methods. 1
FrontPageTest class Drupal\Tests\node\Functional\Views core/modules/node/tests/src/Functional/Views/FrontPageTest.php Tests the default frontpage provided by views.
FrontPageTest class Drupal\Tests\system\Functional\System core/modules/system/tests/src/Functional/System/FrontPageTest.php Tests front page functionality and administration.
Fruit class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityTypeRepositoryTest.php A simple entity for testing. 2
FruitInterface interface Drupal\plugin_test\Plugin\plugin_test\fruit core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/fruit/FruitInterface.php Provides an interface for test plugins. 4 1

Other projects


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