interface TypedDataInterface

Interface for typed data objects.

Hierarchy

Expanded class hierarchy of TypedDataInterface

All classes that implement TypedDataInterface

18 files declare their use of TypedDataInterface
Binary.php in drupal/core/lib/Drupal/Core/TypedData/Type/Binary.php
Definition of Drupal\Core\TypedData\Type\Binary.
Boolean.php in drupal/core/lib/Drupal/Core/TypedData/Type/Boolean.php
Definition of Drupal\Core\TypedData\Type\Boolean.
Date.php in drupal/core/lib/Drupal/Core/TypedData/Type/Date.php
Definition of Drupal\Core\TypedData\Type\Date.
Duration.php in drupal/core/lib/Drupal/Core/TypedData/Type/Duration.php
Definition of Drupal\Core\TypedData\Type\Duration.
EntityFieldTest.php in drupal/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php
Definition of Drupal\Core\Entity\Tests\EntityFieldTest.

... See full list

File

drupal/core/lib/Drupal/Core/TypedData/TypedDataInterface.php, line 15
Definition of Drupal\Core\TypedData\TypedDataInterface.

Namespace

Drupal\Core\TypedData
View source
interface TypedDataInterface {

  /**
   * Gets the data type.
   *
   * @return string
   *   The data type of the wrapped data.
   */
  public function getType();

  /**
   * Gets the data definition.
   *
   * @return array
   *   The data definition array.
   */
  public function getDefinition();

  /**
   * Gets the data value.
   *
   * @return mixed
   */
  public function getValue();

  /**
   * Sets the data value.
   *
   * @param mixed $value
   *   The value to set in the format as documented for the data type or NULL to
   *   unset the data value.
   *
   * @throws \Drupal\Core\TypedData\ReadOnlyException
   *   If the data is read-only.
   */
  public function setValue($value);

  /**
   * Returns a string representation of the data.
   *
   * @return string
   */
  public function getString();

  /**
   * Validates the currently set data value.
   */
  public function validate();

}

Members

Namesort descending Modifiers Type Description Overrides
TypedDataInterface::getDefinition public function Gets the data definition. 1
TypedDataInterface::getString public function Returns a string representation of the data. 1
TypedDataInterface::getType public function Gets the data type. 1
TypedDataInterface::getValue public function Gets the data value. 1
TypedDataInterface::setValue public function Sets the data value. 1
TypedDataInterface::validate public function Validates the currently set data value. 13