"Fossies" - the Fresh Open Source Software Archive

Member "drupal-8.9.9/core/lib/Drupal/Core/TypedData/ListDataDefinitionInterface.php" (18 Nov 2020, 1557 Bytes) of package /linux/www/drupal-8.9.9.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ListDataDefinitionInterface.php" see the Fossies "Dox" file reference documentation.

    1 <?php
    2 
    3 namespace Drupal\Core\TypedData;
    4 
    5 /**
    6  * Interface for data definitions of lists.
    7  *
    8  * This interface is present on a data definition if it describes a list. The
    9  * actual lists implement the \Drupal\Core\TypedData\ListInterface.
   10  *
   11  * @see \Drupal\Core\TypedData\ListDefinition
   12  * @see \Drupal\Core\TypedData\ListInterface
   13  *
   14  * @ingroup typed_data
   15  */
   16 interface ListDataDefinitionInterface extends DataDefinitionInterface {
   17 
   18   /**
   19    * Creates a new list data definition for items of the given data type.
   20    *
   21    * This method is typically used by
   22    * \Drupal\Core\TypedData\TypedDataManager::createListDataDefinition() to
   23    * build a definition object for an arbitrary item type. When the definition
   24    * class is known, it is recommended to directly use the static create()
   25    * method on that class instead; e.g.:
   26    * @code
   27    *   $list_definition = \Drupal\Core\TypedData\ListDataDefinition::create('string');
   28    * @endcode
   29    *
   30    * @param string $item_type
   31    *   The item type, for which a list data definition should be created.
   32    *
   33    * @return static
   34    *
   35    * @throws \InvalidArgumentException
   36    *   If an unsupported data type gets passed to the class; e.g., 'string' to a
   37    *   definition class handling lists of 'field_item:* data types.
   38    */
   39   public static function createFromItemType($item_type);
   40 
   41   /**
   42    * Gets the data definition of an item of the list.
   43    *
   44    * @return \Drupal\Core\TypedData\DataDefinitionInterface
   45    *   A data definition describing the list items.
   46    */
   47   public function getItemDefinition();
   48 
   49 }