SequenceDataDefinition.php 881 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Drupal\Core\Config\Schema;
  3. use Drupal\Core\TypedData\ListDataDefinition;
  4. /**
  5. * A typed data definition class for defining sequences in configuration.
  6. */
  7. class SequenceDataDefinition extends ListDataDefinition {
  8. /**
  9. * Gets the description of how the sequence should be sorted.
  10. *
  11. * Only the top level of the array should be sorted. Top-level keys should be
  12. * discarded when using 'value' sorting. If the sequence is an associative
  13. * array 'key' sorting is recommended, if not 'value' sorting is recommended.
  14. *
  15. * @return string|null
  16. * May be 'key' (to sort by key), 'value' (to sort by value, discarding
  17. * keys), or NULL (if the schema does not describe how the sequence should
  18. * be sorted).
  19. */
  20. public function getOrderBy() {
  21. return isset($this->definition['orderby']) ? $this->definition['orderby'] : NULL;
  22. }
  23. }