function DataDefinition::getClass

Same name in other branches
  1. 9 core/lib/Drupal/Core/TypedData/DataDefinition.php \Drupal\Core\TypedData\DataDefinition::getClass()
  2. 10 core/lib/Drupal/Core/TypedData/DataDefinition.php \Drupal\Core\TypedData\DataDefinition::getClass()
  3. 11.x core/lib/Drupal/Core/TypedData/DataDefinition.php \Drupal\Core\TypedData\DataDefinition::getClass()

Overrides DataDefinitionInterface::getClass

1 method overrides DataDefinition::getClass()
ListDataDefinition::getClass in core/lib/Drupal/Core/TypedData/ListDataDefinition.php
Returns the class used for creating the typed data object.

File

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

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'];
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.