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
QueryOptionsTest class Drupal\Tests\views\Functional\Plugin core/modules/views/tests/src/Functional/Plugin/QueryOptionsTest.php Tests setting the query options.
QueryParameter class Drupal\views\Plugin\views\argument_default core/modules/views/src/Plugin/views/argument_default/QueryParameter.php A query parameter argument default handler. 1
QueryParameterTest class Drupal\Tests\views\Unit\Plugin\argument_default core/modules/views/tests/src/Unit/Plugin/argument_default/QueryParameterTest.php Tests Drupal\views\Plugin\views\argument_default\QueryParameter.
QueryParameterWorkspaceNegotiator class Drupal\workspaces\Negotiator core/modules/workspaces/src/Negotiator/QueryParameterWorkspaceNegotiator.php Defines the query parameter workspace negotiator. 2 2
QueryPluginBase abstract class Drupal\views\Plugin\views\query core/modules/views/src/Plugin/views/query/QueryPluginBase.php Base plugin class for Views queries. 2 14
QueryTest class Drupal\Tests\views\Kernel\Plugin core/modules/views/tests/src/Kernel/Plugin/QueryTest.php Tests query plugins.
QueryTest class Drupal\views_test_data\Plugin\views\query core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php Defines a query test plugin. 1
QueryTest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/QueryTest.php Tests query plugins.
QueryTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/QueryTest.php Tests Drupal's extended prepared statement syntax.
QueryTest class Drupal\Tests\Core\Entity\Query\Sql core/tests/Drupal/Tests/Core/Entity/Query/Sql/QueryTest.php Tests Drupal\Core\Entity\Query\Sql\Query.
QueryTrait trait Drupal\workspaces\EntityQuery core/modules/workspaces/src/EntityQuery/QueryTrait.php Provides workspaces-specific helpers for altering entity queries.
QueueDatabaseFactory class Drupal\Core\Queue core/lib/Drupal/Core/Queue/QueueDatabaseFactory.php Defines the queue factory for the database backend. 2
QueueExceptionsTest class Drupal\Tests\Core\Queue core/tests/Drupal/Tests/Core/Queue/QueueExceptionsTest.php Tests queue exceptions.
QueueFactory class Drupal\Core\Queue core/lib/Drupal/Core/Queue/QueueFactory.php Defines the queue factory. 12 2
QueueFactoryInterface interface Drupal\Core\Queue core/lib/Drupal/Core/Queue/QueueFactoryInterface.php An interface defining queue factory classes. 1 1
QueueGarbageCollectionInterface interface Drupal\Core\Queue core/lib/Drupal/Core/Queue/QueueGarbageCollectionInterface.php Queue garbage collection interface. 1 1
QueueInterface interface Drupal\Core\Queue core/lib/Drupal/Core/Queue/QueueInterface.php Interface for a queue. 3 4
QueueProcessTrait trait Drupal\Core\Queue core/lib/Drupal/Core/Queue/QueueProcessTrait.php Provides a trait for processing queue items. 1
QueueSerializationTest class Drupal\KernelTests\Core\Queue core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php Tests serializing a form with an injected DatabaseQueue instance.
QueueTest class Drupal\KernelTests\Core\Queue core/tests/Drupal/KernelTests/Core/Queue/QueueTest.php Queues and unqueues a set of items to check the basic queue functionality.
QueueWorker class Drupal\Core\Annotation core/lib/Drupal/Core/Annotation/QueueWorker.php Declare a worker class for processing a queue item.
QueueWorker class Drupal\Core\Queue\Attribute core/lib/Drupal/Core/Queue/Attribute/QueueWorker.php Declare a worker class for processing a queue item. 11
QueueWorkerBase abstract class Drupal\Core\Queue core/lib/Drupal/Core/Queue/QueueWorkerBase.php Provides a base implementation for a QueueWorker plugin. 10 10
QueueWorkerInterface interface Drupal\Core\Queue core/lib/Drupal/Core/Queue/QueueWorkerInterface.php Defines an interface for a QueueWorker plugin. 1 2
QueueWorkerManager class Drupal\Core\Queue core/lib/Drupal/Core/Queue/QueueWorkerManager.php Defines the queue worker manager. 2
QueueWorkerManagerInterface interface Drupal\Core\Queue core/lib/Drupal/Core/Queue/QueueWorkerManagerInterface.php Provides an interface for a queue worker manager. 1 3
QuickStartCommand class Drupal\Core\Command core/lib/Drupal/Core/Command/QuickStartCommand.php Installs a Drupal site and starts a webserver for local testing/development.
QuickStartTest class Drupal\BuildTests\QuickStart core/tests/Drupal/BuildTests/QuickStart/QuickStartTest.php Tests the quick-start commands.
QuickStartTestBase abstract class Drupal\BuildTests\QuickStart core/tests/Drupal/BuildTests/QuickStart/QuickStartTestBase.php Helper methods for using the quickstart feature of Drupal. 3 3
QuxTest abstract class Drupal\Tests\Core\Foo core/tests/PHPStan/fixtures/test-classes-with-metadata.php
Radio class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Radio.php Provides a form element for a single radio button.
Radios class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Radios.php Provides a form element for a set of radio buttons. 1
Random abstract class Drupal\TestTools core/tests/Drupal/TestTools/Random.php Provides random generator utility static methods. 20
Random class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Random.php Defines a utility class for creating random data. 30 1
Random class Drupal\views\Plugin\views\sort core/modules/views/src/Plugin/views/sort/Random.php Handle a random sort.
RandomGeneratorTrait trait Drupal\Tests core/tests/Drupal/Tests/RandomGeneratorTrait.php Provides random generator utility methods. 3
RandomTest class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/RandomTest.php Tests random data generation.
Range class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Range.php Provides a slider for input of a number within a specific range.
RangeConstraint class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RangeConstraint.php Range constraint. 1 1
RangeConstraintValidator class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/RangeConstraintValidator.php Validator for the Drupal 'range' constraint. 1 1
RangeQueryTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/RangeQueryTest.php Tests the Range query functionality.
Raw class Drupal\views\Plugin\views\argument_default core/modules/views/src/Plugin/views/argument_default/Raw.php Default argument plugin to use the raw value from the URL. 1
RawConfigWriterTrait trait Drupal\Tests\Traits\Core\Config core/tests/Drupal/Tests/Traits/Core/Config/RawConfigWriterTrait.php Allows writing raw config data for testing purposes. 1
RawStringFormatterTest class Drupal\Tests\field\Kernel\KernelString core/modules/field/tests/src/Kernel/KernelString/RawStringFormatterTest.php Tests the raw string formatter.
RawTest class Drupal\Tests\views\Unit\Plugin\argument_default core/modules/views/tests/src/Unit/Plugin/argument_default/RawTest.php Tests Drupal\views\Plugin\views\argument_default\Raw.
ReadOnlyException class Drupal\Core\TypedData\Exception core/lib/Drupal/Core/TypedData/Exception/ReadOnlyException.php Exception thrown when trying to write or set ready-only data.
ReadOnlyModeMethodFilter class Drupal\jsonapi\Routing core/modules/jsonapi/src/Routing/ReadOnlyModeMethodFilter.php Filters routes based on the HTTP method and JSON:API's read-only mode. 2
ReadOnlyStorage class Drupal\Core\Config core/lib/Drupal/Core/Config/ReadOnlyStorage.php A ReadOnlyStorage decorates a storage and does not allow writing to it. 1
ReadOnlyStorageTest class Drupal\Tests\Core\Config core/tests/Drupal/Tests/Core/Config/ReadOnlyStorageTest.php Tests Drupal\Core\Config\ReadOnlyStorage.
ReadOnlyStream abstract class Drupal\Core\StreamWrapper core/lib/Drupal/Core/StreamWrapper/ReadOnlyStream.php Defines a read-only Drupal stream wrapper base class. 1 1

Other projects


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