BaseFieldDefinition::getFieldItemClass

protected BaseFieldDefinition::getFieldItemClass()

Helper to retrieve the field item class.

@todo: Remove once getClass() adds in defaults. See https://www.drupal.org/node/2116341.

File

core/lib/Drupal/Core/Field/BaseFieldDefinition.php, line 565

Class

BaseFieldDefinition
A class for defining entity fields.

Namespace

Drupal\Core\Field

Code

protected function getFieldItemClass() {
  if ($class = $this->getItemDefinition()->getClass()) {
    return $class;
  }
  else {
    $type_definition = \Drupal::typedDataManager()
      ->getDefinition($this->getItemDefinition()->getDataType());
    return $type_definition['class'];
  }
}
doc_Drupal
2016-10-29 08:45:39
Comments
Leave a Comment

Please login to continue.