ComplexDataDefinitionInterface.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace Drupal\Core\TypedData;
  3. /**
  4. * Interface for complex data definitions.
  5. *
  6. * @see \Drupal\Core\TypedData\ComplexDataInterface
  7. *
  8. * @ingroup typed_data
  9. */
  10. interface ComplexDataDefinitionInterface extends DataDefinitionInterface {
  11. /**
  12. * Gets the definition of a contained property.
  13. *
  14. * @param string $name
  15. * The name of property.
  16. *
  17. * @return \Drupal\Core\TypedData\DataDefinitionInterface|null
  18. * The definition of the property or NULL if the property does not exist.
  19. */
  20. public function getPropertyDefinition($name);
  21. /**
  22. * Gets an array of property definitions of contained properties.
  23. *
  24. * @return \Drupal\Core\TypedData\DataDefinitionInterface[]
  25. * An array of property definitions of contained properties, keyed by
  26. * property name.
  27. */
  28. public function getPropertyDefinitions();
  29. /**
  30. * Returns the name of the main property, if any.
  31. *
  32. * Some field items consist mainly of one main property, e.g. the value of a
  33. * text field or the @code target_id @endcode of an entity reference. If the
  34. * field item has no main property, the method returns NULL.
  35. *
  36. * @return string|null
  37. * The name of the value property, or NULL if there is none.
  38. */
  39. public function getMainPropertyName();
  40. }