DataDefinition::getClass

public DataDefinition::getClass()

Returns the class used for creating the typed data object.

If not specified, the default class of the data type will be returned.

Return value

string The class used for creating the typed data object.

Overrides DataDefinitionInterface::getClass

File

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

Class

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

Namespace

Drupal\Core\TypedData

Code

public function getClass() {
  if (isset($this->definition['class'])) {
    return $this->definition['class'];
  }
  else {
    $type_definition = \Drupal::typedDataManager()->getDefinition($this->getDataType());
    return $type_definition['class'];
  }
}
doc_Drupal
2016-10-29 09:00:04
Comments
Leave a Comment

Please login to continue.