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
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. 4
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\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.
MenuTestBase

in drupal:8.?.? and is removed from drupal:9.0.0. Use \Drupal\Tests\BrowserTestBase instead.

abstract class Drupal\system\Tests\Menu core/modules/system/src/Tests/Menu/MenuTestBase.php Base class for Menu tests.
MenuTestController class Drupal\menu_test\Controller core/modules/system/tests/modules/menu_test/src/Controller/MenuTestController.php Controller routines for menu_test routes.
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. 18
MenuTreeParametersTest class Drupal\Tests\Core\Menu core/tests/Drupal/Tests/Core/Menu/MenuTreeParametersTest.php Tests the menu link tree parameters value object.
MenuTreeSerializationTitleFilledTest class Drupal\Tests\system\Functional\Update core/modules/system/tests/src/Functional/Update/MenuTreeSerializationTitleFilledTest.php Runs MenuTreeSerializationTitleTest with a dump filled with content.
MenuTreeSerializationTitleTest class Drupal\Tests\system\Functional\Update core/modules/system/tests/src/Functional/Update/MenuTreeSerializationTitleTest.php Tests system_update_8001(). 1
MenuTreeStorage class Drupal\Core\Menu core/lib/Drupal/Core/Menu/MenuTreeStorage.php Provides a menu tree storage using the database. 1 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
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.
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. 1 1
MenuUiLanguageTest class Drupal\Tests\menu_ui\Functional core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php Tests for menu_ui language settings.
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.
MenuUiTest class Drupal\Tests\menu_ui\Functional core/modules/menu_ui/tests/src/Functional/MenuUiTest.php Add a custom menu, add menu links to the custom menu and Tools menu, check their data, and delete them using the 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
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.
MenuWebTestBase

in drupal:8.5.0 and is removed from drupal:9.0.0. Use \Drupal\Tests\menu_ui\Traits\MenuUiTrait methods, instead.

abstract class Drupal\menu_ui\Tests core/modules/menu_ui/src/Tests/MenuWebTestBase.php Base class for menu web tests.
MenuXmlAnonTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/MenuXmlAnonTest.php @group rest
MenuXmlBasicAuthTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/MenuXmlBasicAuthTest.php @group rest
MenuXmlCookieTest class Drupal\Tests\system\Functional\Rest core/modules/system/tests/src/Functional/Rest/MenuXmlCookieTest.php @group rest
Merge class Drupal\driver_test\Driver\Database\DrivertestMysql core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Merge.php MySQL test implementation of \Drupal\Core\Database\Query\Merge.
Merge class Drupal\driver_test\Driver\Database\DrivertestPgsql core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Merge.php PostgreSQL implementation of \Drupal\Core\Database\Query\Merge.
Merge class Drupal\Core\Database\Driver\sqlite core/lib/Drupal/Core/Database/Driver/sqlite/Merge.php SQLite implementation of \Drupal\Core\Database\Query\Merge.
Merge class Drupal\Core\Database\Driver\mysql core/lib/Drupal/Core/Database/Driver/mysql/Merge.php MySQL implementation of \Drupal\Core\Database\Query\Merge. 1 1
Merge class Drupal\Core\Database\Driver\pgsql core/lib/Drupal/Core/Database/Driver/pgsql/Merge.php PostgreSQL implementation of \Drupal\Core\Database\Query\Merge. 1 1
Merge class Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/Merge.php General class for an abstracted MERGE query operation. 3 6
MergeTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/MergeTest.php Tests the MERGE query builder.
Message class Drupal\contact\Entity core/modules/contact/src/Entity/Message.php Defines the contact message entity. 3
Message class Drupal\Composer\Plugin\ProjectMessage composer/Plugin/ProjectMessage/Message.php Determine configuration. 1
MessageAction class Drupal\Core\Action\Plugin\Action core/lib/Drupal/Core/Action/Plugin/Action/MessageAction.php Sends a message to the current user's screen.
MessageCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/MessageCommand.php AJAX command for a JavaScript Drupal.message() call. 1
MessageCommandTest class Drupal\FunctionalJavascriptTests\Ajax core/tests/Drupal/FunctionalJavascriptTests/Ajax/MessageCommandTest.php Tests adding messages via AJAX command.
MessageEntityTest class Drupal\Tests\contact\Kernel core/modules/contact/tests/src/Kernel/MessageEntityTest.php Tests the message entity class.
MessageForm class Drupal\contact core/modules/contact/src/MessageForm.php Form controller for contact message forms.
MessageHalJsonAnonTest class Drupal\Tests\contact\Functional\Hal core/modules/contact/tests/src/Functional/Hal/MessageHalJsonAnonTest.php @group hal 2
MessageHalJsonBasicAuthTest class Drupal\Tests\contact\Functional\Hal core/modules/contact/tests/src/Functional/Hal/MessageHalJsonBasicAuthTest.php @group hal
MessageHalJsonCookieTest class Drupal\Tests\contact\Functional\Hal core/modules/contact/tests/src/Functional/Hal/MessageHalJsonCookieTest.php @group hal
MessageInterface interface Drupal\contact core/modules/contact/src/MessageInterface.php Provides an interface defining a contact message entity. 1 2
MessageJsonAnonTest class Drupal\Tests\contact\Functional\Rest core/modules/contact/tests/src/Functional/Rest/MessageJsonAnonTest.php @group rest
MessageJsonBasicAuthTest class Drupal\Tests\contact\Functional\Rest core/modules/contact/tests/src/Functional/Rest/MessageJsonBasicAuthTest.php @group rest

Other projects


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