function ListDataDefinition::setDataType
Same name in other branches
- 8.9.x core/lib/Drupal/Core/TypedData/ListDataDefinition.php \Drupal\Core\TypedData\ListDataDefinition::setDataType()
- 10 core/lib/Drupal/Core/TypedData/ListDataDefinition.php \Drupal\Core\TypedData\ListDataDefinition::setDataType()
- 11.x core/lib/Drupal/Core/TypedData/ListDataDefinition.php \Drupal\Core\TypedData\ListDataDefinition::setDataType()
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\TypedDataCode
public function setDataType($type) {
if ($type != 'list') {
throw new \LogicException('Lists must always be of data type "list".');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.