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
NodeTypeTest class Drupal\Tests\node\Kernel\Plugin\migrate\source\d7 core/modules/node/tests/src/Kernel/Plugin/migrate/source/d7/NodeTypeTest.php Tests D7 node type source plugin.
NodeTypeTest class Drupal\Tests\node\Functional core/modules/node/tests/src/Functional/NodeTypeTest.php Ensures that node type functions work correctly.
NodeTypeTranslationTest class Drupal\Tests\node\Functional core/modules/node/tests/src/Functional/NodeTypeTranslationTest.php Ensures that node types translation work correctly.
NodeTypeValidationTest class Drupal\Tests\node\Kernel core/modules/node/tests/src/Kernel/NodeTypeValidationTest.php Tests validation of node_type entities.
NodeTypeXmlAnonTest class Drupal\Tests\node\Functional\Rest core/modules/node/tests/src/Functional/Rest/NodeTypeXmlAnonTest.php Tests Node Type Xml Anon.
NodeTypeXmlBasicAuthTest class Drupal\Tests\node\Functional\Rest core/modules/node/tests/src/Functional/Rest/NodeTypeXmlBasicAuthTest.php Tests Node Type Xml Basic Auth.
NodeTypeXmlCookieTest class Drupal\Tests\node\Functional\Rest core/modules/node/tests/src/Functional/Rest/NodeTypeXmlCookieTest.php Tests Node Type Xml Cookie.
NodeUpdate7008

in drupal:11.3.0 and is removed from drupal:12.0.0. There is no replacement.

class Drupal\node\Plugin\migrate\process\d6 core/modules/node/src/Plugin/migrate/process/d6/NodeUpdate7008.php Split the 'administer nodes' permission from 'access content overview'.
NodeUserHooks class Drupal\node\Hook core/modules/node/src/Hook/NodeUserHooks.php Hook implementations for the node module.
NodeValidationTest class Drupal\Tests\node\Kernel core/modules/node/tests/src/Kernel/NodeValidationTest.php Tests node validation constraints.
NodeViewBuilder class Drupal\node core/modules/node/src/NodeViewBuilder.php View builder handler for nodes. 2
NodeViewBuilderTest class Drupal\Tests\node\Kernel core/modules/node/tests/src/Kernel/NodeViewBuilderTest.php Tests the node view builder.
NodeViewController

in drupal:11.4.0 and is removed from drupal:13.0.0. Use \Drupal\Core\Entity\Controller\EntityViewController instead.

class Drupal\node\Controller core/modules/node/src/Controller/NodeViewController.php Defines a controller to render a single node.
NodeViewLanguageTest class Drupal\Tests\node\Functional core/modules/node/tests/src/Functional/NodeViewLanguageTest.php Tests the node language extra field display.
NodeViewsAnalyzeTest class Drupal\Tests\node\Functional\Views core/modules/node/tests/src/Functional/Views/NodeViewsAnalyzeTest.php Tests node_views_analyze().
NodeViewsData class Drupal\node core/modules/node/src/NodeViewsData.php Provides the views data for the node entity type. 1
NodeViewsFieldAccessTest class Drupal\Tests\node\Kernel\Views core/modules/node/tests/src/Kernel/Views/NodeViewsFieldAccessTest.php Tests base field access in Views for the node entity.
NodeViewsHooks class Drupal\node\Hook core/modules/node/src/Hook/NodeViewsHooks.php Views hook implementations for node.
NodeViewTest class Drupal\Tests\node\Functional core/modules/node/tests/src/Functional/NodeViewTest.php Tests the node/{node} page.
NodeWizardTest class Drupal\Tests\views\Functional\Wizard core/modules/views/tests/src/Functional/Wizard/NodeWizardTest.php Tests node wizard and generic entity integration.
NodeXmlAnonTest class Drupal\Tests\node\Functional\Rest core/modules/node/tests/src/Functional/Rest/NodeXmlAnonTest.php Tests Node Xml Anon.
NodeXmlBasicAuthTest class Drupal\Tests\node\Functional\Rest core/modules/node/tests/src/Functional/Rest/NodeXmlBasicAuthTest.php Tests Node Xml Basic Auth.
NodeXmlCookieTest class Drupal\Tests\node\Functional\Rest core/modules/node/tests/src/Functional/Rest/NodeXmlCookieTest.php Tests Node Xml Cookie.
NoFieldItemsExistWithHigherCardinality class Drupal\field\Plugin\Validation\Constraint core/modules/field/src/Plugin/Validation/Constraint/NoFieldItemsExistWithHigherCardinality.php Checks if field items exist that exceed the allowed cardinality. 1
NoFieldItemsExistWithHigherCardinalityTest class Drupal\Tests\field\Unit\Plugin\Validation\Constraint core/modules/field/tests/src/Unit/Plugin/Validation/Constraint/NoFieldItemsExistWithHigherCardinalityTest.php Tests the NoFieldItemsExistWithHigherCardinality constraint.
NoFieldItemsExistWithHigherCardinalityTest class Drupal\Tests\field\Kernel\Plugin\Validation\Constraint core/modules/field/tests/src/Kernel/Plugin/Validation/Constraint/NoFieldItemsExistWithHigherCardinalityTest.php Tests NoFieldItemsExistWithHigherCardinality validation.
NoFieldItemsExistWithHigherCardinalityValidator class Drupal\field\Plugin\Validation\Constraint core/modules/field/src/Plugin/Validation/Constraint/NoFieldItemsExistWithHigherCardinalityValidator.php Validates the NoFieldItemsExistWithHigherCardinality constraint. 1
NoFieldsException class Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/NoFieldsException.php Exception thrown if an insert query doesn't specify insert or default fields. 1
NoHelpTest class Drupal\Tests\help\Kernel core/modules/help/tests/src/Kernel/NoHelpTest.php Verify no help is displayed for modules not providing any help.
NoHelpTest class Drupal\Tests\help\Functional core/modules/help/tests/src/Functional/NoHelpTest.php Verify no help is displayed for modules not providing any help.
NoInstantiationMockStaticCallable class Drupal\Tests\Core\Utility core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php Test class for testing a mock static callable.
NoLanguageEntityTest class Drupal\language_test\Entity core/modules/language/tests/language_test/src/Entity/NoLanguageEntityTest.php Defines the test entity class. 1
NoMethodCallable class Drupal\Tests\Core\Utility core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php A test class with no callable methods.
NoMultilingualReviewPageTest class Drupal\Tests\migrate_drupal_ui\Functional\d6 core/modules/migrate_drupal_ui/tests/src/Functional/d6/NoMultilingualReviewPageTest.php Tests migrate upgrade review page for Drupal 6 without translations.
NoMultilingualReviewPageTest class Drupal\Tests\migrate_drupal_ui\Functional\d7 core/modules/migrate_drupal_ui/tests/src/Functional/d7/NoMultilingualReviewPageTest.php Tests Drupal 7 upgrade without translations.
NoMultilingualReviewPageTest class Drupal\Tests\contact\Functional\migrate_drupal_ui\d6 core/modules/contact/tests/src/Functional/migrate_drupal_ui/d6/NoMultilingualReviewPageTest.php Tests migrate upgrade review page for Drupal 6 without translations.
NoMultilingualReviewPageTest class Drupal\Tests\contact\Functional\migrate_drupal_ui\d7 core/modules/contact/tests/src/Functional/migrate_drupal_ui/d7/NoMultilingualReviewPageTest.php Tests Drupal 7 upgrade without translations.
NoMultilingualReviewPageTestBase abstract class Drupal\Tests\migrate_drupal_ui\Functional core/modules/migrate_drupal_ui/tests/src/Functional/NoMultilingualReviewPageTestBase.php Tests the upgrade review form without translations. 4 4
NonAbstractFormStateDecoratorBase class Drupal\Tests\Core\Form core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php Provides a non-abstract version of the class under test.
NonAnnotatedClass class Drupal\plugin_test\Plugin\plugin_test\fruit core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/fruit/NonAnnotatedClass.php A non-annotated test plugin class.
NonDefaultBlockAdminTest class Drupal\Tests\block\Functional core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php Tests the block administration page for a non-default theme.
None class Drupal\views\Plugin\views\argument_validator core/modules/views/src/Plugin/views/argument_validator/None.php Do not validate the argument.
None class Drupal\views\Plugin\views\cache core/modules/views/src/Plugin/views/cache/None.php Caching plugin that provides no caching at all. 1
None class Drupal\views\Plugin\views\access core/modules/views/src/Plugin/views/access/None.php Access plugin that provides no access control at all. 1
None class Drupal\views\Plugin\views\pager core/modules/views/src/Plugin/views/pager/None.php Plugin for views without pagers. 1
Nonexistent final class Drupal\Tests\Component\Annotation\Doctrine\Fixtures\Attribute core/tests/Drupal/Tests/Component/Annotation/Doctrine/Fixtures/Attribute/Nonexistent.php #[NonexistentAttribute]
NonInheritingBundleClass class Drupal\entity_test_bundle_class\Entity core/modules/system/tests/modules/entity_test_bundle_class/src/Entity/NonInheritingBundleClass.php An invalid bundle class which does not inherit the main entity class. 1
NonPublicSchemaTest class Drupal\Tests\pgsql\Kernel\pgsql core/modules/pgsql/tests/src/Kernel/pgsql/NonPublicSchemaTest.php Tests schema API for non-public schema for the PostgreSQL driver.
NonStableModulesTest class Drupal\Tests\system\Functional\Module core/modules/system/tests/src/Functional/Module/NonStableModulesTest.php Tests the installation of deprecated and experimental modules.
NoOpStager final class Drupal\package_manager_bypass core/modules/package_manager/tests/modules/package_manager_bypass/src/NoOpStager.php A composer-stager Stager implementation that does nothing, except logging. 2

Other projects


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