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

Name Type Namespace Locationsort descending Description Direct uses Use statements Strings
HtmlEscapedText class Drupal\Component\Render core/lib/Drupal/Component/Render/HtmlEscapedText.php Escapes HTML syntax characters to HTML entities for display in markup. 2
MarkupInterface interface Drupal\Component\Render core/lib/Drupal/Component/Render/MarkupInterface.php Marks an object's __toString() method as returning markup. 13 36
MarkupTrait trait Drupal\Component\Render core/lib/Drupal/Component/Render/MarkupTrait.php Implements MarkupInterface and Countable for rendered objects. 8
OutputStrategyInterface interface Drupal\Component\Render core/lib/Drupal/Component/Render/OutputStrategyInterface.php Provides an output strategy that formats HTML strings for a given context. 1
PlainTextOutput class Drupal\Component\Render core/lib/Drupal/Component/Render/PlainTextOutput.php Provides an output strategy for transforming HTML into simple plain text. 12
InvalidDataTypeException class Drupal\Component\Serialization\Exception core/lib/Drupal/Component/Serialization/Exception/InvalidDataTypeException.php Exception thrown when a data type is invalid. 1 17
Json class Drupal\Component\Serialization core/lib/Drupal/Component/Serialization/Json.php Default serialization for JSON. 95 3
ObjectAwareSerializationInterface interface Drupal\Component\Serialization core/lib/Drupal/Component/Serialization/ObjectAwareSerializationInterface.php Ensures that a serializer is usable for serializing PHP objects. 1
PhpSerialize class Drupal\Component\Serialization core/lib/Drupal/Component/Serialization/PhpSerialize.php Default serialization for serialized PHP. 3 2
SerializationInterface interface Drupal\Component\Serialization core/lib/Drupal/Component/Serialization/SerializationInterface.php Defines an interface for serialization formats. 5 3
Yaml class Drupal\Component\Serialization core/lib/Drupal/Component/Serialization/Yaml.php Provides a YAML serialization implementation using symfony/yaml. 10 2
YamlPecl class Drupal\Component\Serialization core/lib/Drupal/Component/Serialization/YamlPecl.php Provides default serialization for YAML using the PECL extension. 1
YamlSymfony Deprecated class Drupal\Component\Serialization core/lib/Drupal/Component/Serialization/YamlSymfony.php Default serialization for YAML using the Symfony component.
PhpTransliteration class Drupal\Component\Transliteration core/lib/Drupal/Component/Transliteration/PhpTransliteration.php Implements transliteration without using the PECL extensions. 1 4
TransliterationInterface interface Drupal\Component\Transliteration core/lib/Drupal/Component/Transliteration/TransliterationInterface.php Defines an interface for classes providing transliteration. 1 4
ArgumentsResolver class Drupal\Component\Utility core/lib/Drupal/Component/Utility/ArgumentsResolver.php Resolves the arguments to pass to a callable. 3
ArgumentsResolverInterface interface Drupal\Component\Utility core/lib/Drupal/Component/Utility/ArgumentsResolverInterface.php Resolves the arguments to pass to a callable. 1 1
Color class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Color.php Performs color conversions. 2
Crypt class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Crypt.php Utility class for cryptographically-secure string handling routines. 63
DeprecatedArray class Drupal\Component\Utility core/lib/Drupal/Component/Utility/DeprecatedArray.php An array that triggers a deprecation warning when accessed.
DeprecationHelper final class Drupal\Component\Utility core/lib/Drupal/Component/Utility/DeprecationHelper.php Provides a helper method for handling deprecated code paths in projects.
DiffArray class Drupal\Component\Utility core/lib/Drupal/Component/Utility/DiffArray.php Provides helpers to perform diffs on multi dimensional arrays. 3
EmailValidator class Drupal\Component\Utility core/lib/Drupal/Component/Utility/EmailValidator.php Validates email addresses. 1 2
EmailValidatorInterface interface Drupal\Component\Utility core/lib/Drupal/Component/Utility/EmailValidatorInterface.php Validates email addresses. 1 1
Environment class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Environment.php Provides PHP environment helper methods. 8
Html class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Html.php Provides DOMDocument helpers for parsing and serializing HTML strings. 141
HtmlSerializerRules class Drupal\Component\Utility core/lib/Drupal/Component/Utility/HtmlSerializerRules.php Drupal-specific HTML5 serializer rules.
Image class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Image.php Provides helpers to operate on images. 1
NestedArray class Drupal\Component\Utility core/lib/Drupal/Component/Utility/NestedArray.php Provides helpers to perform operations on nested arrays and array keys of variable depth. 86
Number class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Number.php Provides helper methods for manipulating numbers. 3
OpCodeCache class Drupal\Component\Utility core/lib/Drupal/Component/Utility/OpCodeCache.php Provides helpers to handle PHP opcode caches. 1
Rectangle class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Rectangle.php Rectangle rotation algebra class. 1
Reflection final class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Reflection.php Provides helper methods for reflection. 2
SortArray class Drupal\Component\Utility core/lib/Drupal/Component/Utility/SortArray.php Provides generic array sorting helper methods. 5
Tags class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Tags.php Defines a class that can explode and implode tags. 7
Timer class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Timer.php Provides helpers to use timers throughout a request. 3
ToStringTrait trait Drupal\Component\Utility core/lib/Drupal/Component/Utility/ToStringTrait.php Wraps __toString in a trait to avoid some fatal errors. 2
Unicode class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Unicode.php Provides Unicode-related conversions and operations. 33
UrlHelper class Drupal\Component\Utility core/lib/Drupal/Component/Utility/UrlHelper.php Helper class URL based methods. 59
UserAgent class Drupal\Component\Utility core/lib/Drupal/Component/Utility/UserAgent.php Provides user agent related utility functions. 2
Variable class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Variable.php Provides helpers for dealing with variables. 8
Xss class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Xss.php Provides helper to filter for cross-site scripting. 1 30
Com class Drupal\Component\Uuid core/lib/Drupal/Component/Uuid/Com.php Generates a UUID using the Windows internal GUID extension. 1
Pecl class Drupal\Component\Uuid core/lib/Drupal/Component/Uuid/Pecl.php Generates a UUID using the PECL extension. 1
Php class Drupal\Component\Uuid core/lib/Drupal/Component/Uuid/Php.php Generates a UUID v4 (RFC 4122 section 4.4) using PHP code. 4 2
Uuid class Drupal\Component\Uuid core/lib/Drupal/Component/Uuid/Uuid.php UUID Helper methods. 6
UuidInterface interface Drupal\Component\Uuid core/lib/Drupal/Component/Uuid/UuidInterface.php Interface for generating UUIDs. 3 11
Constraint class Drupal\Component\Version core/lib/Drupal/Component/Version/Constraint.php A value object representing a Drupal version constraint. 3
AccessArgumentsResolverFactory class Drupal\Core\Access core/lib/Drupal/Core/Access/AccessArgumentsResolverFactory.php Resolves the arguments to pass to an access check callable. 2
AccessArgumentsResolverFactoryInterface interface Drupal\Core\Access core/lib/Drupal/Core/Access/AccessArgumentsResolverFactoryInterface.php Constructs the arguments resolver instance to use when running access checks. 1

Pages

Other projects