Drupal 8  8.0.2
ListDataDefinition Class Reference
Inheritance diagram for ListDataDefinition:

Public Member Functions

 __construct (array $values=array(), DataDefinitionInterface $item_definition=NULL)
 
 getDataType ()
 
 setDataType ($type)
 
 getClass ()
 
 getItemDefinition ()
 
 setItemDefinition (DataDefinitionInterface $definition)
 
- Public Member Functions inherited from DataDefinition
 __construct (array $values=array())
 
 getDataType ()
 
 setDataType ($type)
 
 getLabel ()
 
 setLabel ($label)
 
 getDescription ()
 
 setDescription ($description)
 
 isList ()
 
 isReadOnly ()
 
 setReadOnly ($read_only)
 
 isComputed ()
 
 setComputed ($computed)
 
 isRequired ()
 
 setRequired ($required)
 
 getClass ()
 
 setClass ($class)
 
 getSettings ()
 
 setSettings (array $settings)
 
 getSetting ($setting_name)
 
 setSetting ($setting_name, $value)
 
 getConstraints ()
 
 getConstraint ($constraint_name)
 
 setConstraints (array $constraints)
 
 addConstraint ($constraint_name, $options=NULL)
 
 offsetExists ($offset)
 
offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 toArray ()
 

Static Public Member Functions

static create ($item_type)
 
static createFromDataType ($type)
 
static createFromItemType ($item_type)
 
- Static Public Member Functions inherited from DataDefinition
static create ($type)
 
static createFromDataType ($type)
 

Protected Attributes

 $itemDefinition
 
- Protected Attributes inherited from DataDefinition
 $definition = array()
 

Detailed Description

A typed data definition class for defining lists.

Constructor & Destructor Documentation

__construct ( array  $values = array(),
DataDefinitionInterface  $item_definition = NULL 
)

{}

Member Function Documentation

static create (   $item_type)
static

Creates a new list definition.

Parameters
string$item_typeThe data type of the list items; e.g., 'string', 'integer' or 'any'.
Returns
A new List Data Definition object.

Referenced by TypedDataDefinitionTest\testLists(), TypedDataTest\testTypedDataLists(), and TypedDataTest\testTypedDataListsFilter().

Here is the caller graph for this function:

static createFromDataType (   $type)
static

{Creates a new data definition object.This method is typically used by ::createDataDefinition() to build a definition object for an arbitrary data type. When the definition class is known, it is recommended to directly use the static create() method on that class instead; e.g.:

Parameters
string$data_typeThe data type, for which a data definition should be created.
Returns
static
Exceptions
\InvalidArgumentExceptionIf an unsupported data type gets passed to the class; e.g., 'string' to a definition class handling 'entity:* data types.
}

Implements DataDefinitionInterface.

References DataDefinition\create().

Referenced by FieldConfigBase\createFromDataType().

Here is the call graph for this function:

Here is the caller graph for this function:

static createFromItemType (   $item_type)
static

{Creates a new list data definition for items of the given data type.This method is typically used by ::createListDataDefinition() to build a definition object for an arbitrary item type. When the definition class is known, it is recommended to directly use the static create() method on that class instead; e.g.:

Parameters
string$item_typeThe item type, for which a list data definition should be created.
Returns
static
Exceptions
\InvalidArgumentExceptionIf an unsupported data type gets passed to the class; e.g., 'string' to a definition class handling lists of 'field_item:* data types.
}

Implements ListDataDefinitionInterface.

References Drupal\typedDataManager().

Here is the call graph for this function:

getClass ( )

{Returns the class used for creating the typed data object.If not specified, the default class of the data type will be returned.

Returns
string The class used for creating the typed data object.
}

Implements DataDefinitionInterface.

References ListDataDefinition\getDataType(), ListDataDefinition\getItemDefinition(), and Drupal\typedDataManager().

Referenced by BaseFieldDefinition\getDefaultValue(), and BaseFieldDefinition\getFieldItemClass().

Here is the call graph for this function:

Here is the caller graph for this function:

getDataType ( )

{Returns the data type of the data.

Returns
string The data type.
}

Implements DataDefinitionInterface.

Referenced by ListDataDefinition\getClass(), and BaseFieldDefinition\getFieldItemClass().

Here is the caller graph for this function:

getItemDefinition ( )

{Gets the data definition of an item of the list.

Returns
A data definition describing the list items.
}

Implements ListDataDefinitionInterface.

Referenced by BaseFieldDefinition\addPropertyConstraints(), ListDataDefinition\getClass(), BaseFieldDefinition\getFieldItemClass(), BaseFieldDefinition\getSetting(), BaseFieldDefinition\getSettings(), BaseFieldDefinition\setPropertyConstraints(), BaseFieldDefinition\setSetting(), and BaseFieldDefinition\setSettings().

Here is the caller graph for this function:

setDataType (   $type)

{}

setItemDefinition ( DataDefinitionInterface  $definition)

Sets the item definition.

Parameters
\Drupal\Core\TypedData\DataDefinition$definitionA list item's data definition.
Returns
$this

The documentation for this class was generated from the following file: