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
MenuParentFormSelectorInterface interface Drupal\Core\Menu core/lib/Drupal/Core/Menu/MenuParentFormSelectorInterface.php Defines an interface for menu selector form elements and menu link options. 1 7
MenuPreprocess class Drupal\Core\Menu core/lib/Drupal/Core/Menu/MenuPreprocess.php Menu theme preprocess. 1 2
MenuResourceTestBase abstract class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/MenuResourceTestBase.php Resource test base for the menu entity. 6
MenuRouterRebuildSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php Rebuilds the default menu links and runs menu-specific code if necessary. 2
MenuRouterTest class Drupal\Tests\system\Functional\Menu core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php Tests menu router and default menu link functionality.
MenuSettingsConstraint class Drupal\menu_ui\Plugin\Validation\Constraint core/modules/menu_ui/src/Plugin/Validation/Constraint/MenuSettingsConstraint.php Validation constraint for changing the menu settings in pending revisions.
MenuSettingsConstraintValidator class Drupal\menu_ui\Plugin\Validation\Constraint core/modules/menu_ui/src/Plugin/Validation/Constraint/MenuSettingsConstraintValidator.php Constraint validator for changing the menu settings in pending revisions.
MenuStorage class Drupal\system core/modules/system/src/MenuStorage.php Defines the storage class for menu configuration entities. 5
MenuStorageTest class Drupal\Tests\system\Kernel\Menu core/modules/system/tests/src/Kernel/Menu/MenuStorageTest.php Tests MenuStorage.
MenuTest class Drupal\Tests\system\Kernel\Plugin\migrate\source core/modules/system/tests/src/Kernel/Plugin/migrate/source/MenuTest.php Tests menu source plugin.
MenuTest class Drupal\migrate_drupal_message_test\Plugin\migrate\source core/modules/migrate_drupal_ui/tests/modules/migrate_drupal_message_test/src/Plugin/migrate/source/MenuTest.php Source plugin with a source id removed from the array returned by fields().
MenuTest class Drupal\Tests\views\Functional\Wizard core/modules/views/tests/src/Functional/Wizard/MenuTest.php Tests the ability of the views wizard to put views in a menu.
MenuTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/MenuTest.php JSON:API integration test for the "Menu" config entity type.
MenuTestController class Drupal\menu_test\Controller core/modules/system/tests/modules/menu_test/src/Controller/MenuTestController.php Controller routines for menu_test routes.
MenuTestHelper final class Drupal\menu_test core/modules/system/tests/modules/menu_test/src/MenuTestHelper.php Helper class for the menu API tests. 2
MenuTestHooks class Drupal\menu_test\Hook core/modules/system/tests/modules/menu_test/src/Hook/MenuTestHooks.php Hook implementations for menu_test.
MenuTestServiceProvider class Drupal\menu_test core/modules/system/tests/modules/menu_test/src/MenuTestServiceProvider.php Decorate core's default path-based breadcrumb builder when it is available.
MenuTranslation class Drupal\system\Plugin\migrate\source\d7 core/modules/system/src/Plugin/migrate/source/d7/MenuTranslation.php Drupal 7 i18n menu translation source from database. 1
MenuTranslationTest class Drupal\Tests\system\Kernel\Plugin\migrate\source\d7 core/modules/system/tests/src/Kernel/Plugin/migrate/source/d7/MenuTranslationTest.php Tests the menu translation source plugin.
MenuTreeHierarchyConstraint class Drupal\menu_link_content\Plugin\Validation\Constraint core/modules/menu_link_content/src/Plugin/Validation/Constraint/MenuTreeHierarchyConstraint.php Validation constraint for changing the menu hierarchy in pending revisions.
MenuTreeHierarchyConstraintValidator class Drupal\menu_link_content\Plugin\Validation\Constraint core/modules/menu_link_content/src/Plugin/Validation/Constraint/MenuTreeHierarchyConstraintValidator.php Constraint validator for changing menu link parents in pending revisions.
MenuTreeParameters class Drupal\Core\Menu core/lib/Drupal/Core/Menu/MenuTreeParameters.php Provides a value object to model menu tree parameters. 24
MenuTreeParametersTest class Drupal\Tests\Core\Menu core/tests/Drupal/Tests/Core/Menu/MenuTreeParametersTest.php Tests the menu link tree parameters value object.
MenuTreeStorage class Drupal\Core\Menu core/lib/Drupal/Core/Menu/MenuTreeStorage.php Provides a menu tree storage using the database. 1 2 2
MenuTreeStorageInterface interface Drupal\Core\Menu core/lib/Drupal/Core/Menu/MenuTreeStorageInterface.php Defines an interface for storing a menu tree containing menu link IDs. 1 2
MenuTreeStorageSchemaUpdateTest class Drupal\Tests\system\Functional\Update core/modules/system/tests/src/Functional/Update/MenuTreeStorageSchemaUpdateTest.php Tests update of menu tree storage fields.
MenuTreeStorageTest class Drupal\KernelTests\Core\Menu core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php Tests the menu tree storage.
MenuUiContentModerationTest class Drupal\Tests\menu_ui\Functional core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php Tests Menu UI and Content Moderation integration.
MenuUiContentTranslationTest class Drupal\Tests\menu_ui\Functional core/modules/menu_ui/tests/src/Functional/MenuUiContentTranslationTest.php Tests Menu UI and Content Translation integration for content entities.
MenuUiHooks class Drupal\menu_ui\Hook core/modules/menu_ui/src/Hook/MenuUiHooks.php Hook implementations for menu_ui. 3
MenuUiJavascriptTest class Drupal\Tests\menu_ui\FunctionalJavascript core/modules/menu_ui/tests/src/FunctionalJavascript/MenuUiJavascriptTest.php Tests custom menu and menu links operations using the UI.
MenuUiLanguageTest class Drupal\Tests\menu_ui\Functional core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php Tests for menu_ui language settings.
MenuUiMenuTreeManipulators class Drupal\menu_ui\Menu core/modules/menu_ui/src/Menu/MenuUiMenuTreeManipulators.php Provides menu tree manipulators to be used when managing menu links. 2
MenuUiNodeAccessTest class Drupal\Tests\menu_ui\Functional core/modules/menu_ui/tests/src/Functional/MenuUiNodeAccessTest.php Edit a node when you don't have permission to add or edit menu links.
MenuUiNodeTest class Drupal\Tests\menu_ui\Functional core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php Add, edit, and delete a node with menu link.
MenuUiNodeTypeTest class Drupal\Tests\menu_ui\Kernel core/modules/menu_ui/tests/src/Kernel/MenuUiNodeTypeTest.php Tests menu settings when creating and editing content types.
MenuUiTest class Drupal\Tests\menu_ui\Functional core/modules/menu_ui/tests/src/Functional/MenuUiTest.php Tests the menu UI.
MenuUiThemeHooks class Drupal\menu_ui\Hook core/modules/menu_ui/src/Hook/MenuUiThemeHooks.php Hook implementations for menu_ui.
MenuUiTrait trait Drupal\Tests\menu_ui\Traits core/modules/menu_ui/tests/src/Traits/MenuUiTrait.php Provides common methods for Menu UI module tests. 3
MenuUiUtility class Drupal\menu_ui core/modules/menu_ui/src/MenuUiUtility.php Utility functions for menu_ui. 6
MenuUninstallTest class Drupal\Tests\menu_ui\Functional core/modules/menu_ui/tests/src/Functional/MenuUninstallTest.php Tests that uninstalling menu does not remove custom menus.
MenuValidationTest class Drupal\Tests\system\Kernel\Entity core/modules/system/tests/src/Kernel/Entity/MenuValidationTest.php Tests validation of menu entities.
MenuXmlAnonTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/MenuXmlAnonTest.php Tests Menu Xml Anon.
MenuXmlBasicAuthTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/MenuXmlBasicAuthTest.php Tests Menu Xml Basic Auth.
MenuXmlCookieTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/MenuXmlCookieTest.php Tests Menu Xml Cookie.
Merge class Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/Merge.php General class for an abstracted MERGE query operation. 1 5
Merge class Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses core/tests/fixtures/database_drivers/module/core_fake/src/Driver/Database/CoreFakeWithAllCustomClasses/Merge.php CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Merge.
MergeTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/MergeTest.php Tests the MERGE query builder.
Message class Drupal\Composer\Plugin\ProjectMessage composer/Plugin/ProjectMessage/Message.php Determine configuration. 1
Message class Drupal\contact\Entity core/modules/contact/src/Entity/Message.php Defines the contact message entity. 3

Other projects


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