DataDefinition::create

public static DataDefinition::create($type)

Creates a new data definition.

Parameters

string $type: The data type of the data; e.g., 'string', 'integer' or 'any'.

Return value

static A new DataDefinition object.

File

core/lib/Drupal/Core/TypedData/DataDefinition.php, line 26

Class

DataDefinition
A typed data definition class for defining data based on defined data types.

Namespace

Drupal\Core\TypedData

Code

public static function create($type) {
  $definition['type'] = $type;
  return new static($definition);
}
doc_Drupal
2016-10-29 09:00:04
Comments
Leave a Comment

Please login to continue.