ListDataDefinition::setDataType

public ListDataDefinition::setDataType($type)

Sets the data type.

Parameters

string $type: The data type to set.

Return value

static The object itself for chaining.

Overrides DataDefinition::setDataType

File

core/lib/Drupal/Core/TypedData/ListDataDefinition.php, line 65

Class

ListDataDefinition
A typed data definition class for defining lists.

Namespace

Drupal\Core\TypedData

Code

public function setDataType($type) {
  if ($type != 'list') {
    throw new \LogicException('Lists must always be of data type "list".');
  }
}
doc_Drupal
2016-10-29 09:23:29
Comments
Leave a Comment

Please login to continue.