interface ComplexDataDefinitionInterface

Same name in other branches
  1. 9 core/lib/Drupal/Core/TypedData/ComplexDataDefinitionInterface.php \Drupal\Core\TypedData\ComplexDataDefinitionInterface
  2. 10 core/lib/Drupal/Core/TypedData/ComplexDataDefinitionInterface.php \Drupal\Core\TypedData\ComplexDataDefinitionInterface
  3. 11.x core/lib/Drupal/Core/TypedData/ComplexDataDefinitionInterface.php \Drupal\Core\TypedData\ComplexDataDefinitionInterface

Interface for complex data definitions.

Hierarchy

Expanded class hierarchy of ComplexDataDefinitionInterface

All classes that implement ComplexDataDefinitionInterface

See also

\Drupal\Core\TypedData\ComplexDataInterface

Related topics

7 files declare their use of ComplexDataDefinitionInterface
EntityDataDefinitionInterface.php in core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinitionInterface.php
EntityFieldTest.php in core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php
EntityTypedDataDefinitionTest.php in core/tests/Drupal/KernelTests/Core/Entity/EntityTypedDataDefinitionTest.php
FieldItemDataDefinitionInterface.php in core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinitionInterface.php
FieldResolver.php in core/modules/jsonapi/src/Context/FieldResolver.php

... See full list

File

core/lib/Drupal/Core/TypedData/ComplexDataDefinitionInterface.php, line 12

Namespace

Drupal\Core\TypedData
View source
interface ComplexDataDefinitionInterface extends DataDefinitionInterface {
    
    /**
     * Gets the definition of a contained property.
     *
     * @param string $name
     *   The name of property.
     *
     * @return \Drupal\Core\TypedData\DataDefinitionInterface|null
     *   The definition of the property or NULL if the property does not exist.
     */
    public function getPropertyDefinition($name);
    
    /**
     * Gets an array of property definitions of contained properties.
     *
     * @return \Drupal\Core\TypedData\DataDefinitionInterface[]
     *   An array of property definitions of contained properties, keyed by
     *   property name.
     */
    public function getPropertyDefinitions();
    
    /**
     * Returns the name of the main property, if any.
     *
     * Some field items consist mainly of one main property, e.g. the value of a
     * text field or the @code target_id @endcode of an entity reference. If the
     * field item has no main property, the method returns NULL.
     *
     * @return string|null
     *   The name of the value property, or NULL if there is none.
     */
    public function getMainPropertyName();

}

Members

Title Sort descending Modifiers Object type Summary Overrides
ComplexDataDefinitionInterface::getMainPropertyName public function Returns the name of the main property, if any. 2
ComplexDataDefinitionInterface::getPropertyDefinition public function Gets the definition of a contained property. 2
ComplexDataDefinitionInterface::getPropertyDefinitions public function Gets an array of property definitions of contained properties. 2
DataDefinitionInterface::addConstraint public function Adds a validation constraint. 2
DataDefinitionInterface::createFromDataType public static function Creates a new data definition object. 2
DataDefinitionInterface::getClass public function Returns the class used for creating the typed data object. 2
DataDefinitionInterface::getConstraint public function Returns a validation constraint. 2
DataDefinitionInterface::getConstraints public function Returns an array of validation constraints. 2
DataDefinitionInterface::getDataType public function Returns the data type of the data. 2
DataDefinitionInterface::getDescription public function Returns a human readable description. 2
DataDefinitionInterface::getLabel public function Returns a human readable label. 2
DataDefinitionInterface::getSetting public function Returns the value of a given setting. 2
DataDefinitionInterface::getSettings public function Returns the array of settings, as required by the used class. 2
DataDefinitionInterface::isComputed public function Determines whether the data value is computed. 3
DataDefinitionInterface::isInternal public function Determines whether the data value is internal. 2
DataDefinitionInterface::isList public function Returns whether the data is multi-valued, i.e. a list of data items. 2
DataDefinitionInterface::isReadOnly public function Determines whether the data is read-only. 3
DataDefinitionInterface::isRequired public function Determines whether a data value is required. 2

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