You are here

protected function BaseFieldDefinition::getFieldItemClass in Drupal 8

Helper to retrieve the field item class.

Deprecated

in drupal:8.5.0 and is removed from drupal:9.0.0. Use \Drupal\Core\TypedData\ListDataDefinition::getClass() instead.

File

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

Class

BaseFieldDefinition
A class for defining entity fields.

Namespace

Drupal\Core\Field

Code

protected function getFieldItemClass() {
  @trigger_error('BaseFieldDefinition::getFieldItemClass() is deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. Instead, you should use \\Drupal\\Core\\TypedData\\ListDataDefinition::getClass(). See https://www.drupal.org/node/2933964.', E_USER_DEPRECATED);
  if ($class = $this
    ->getItemDefinition()
    ->getClass()) {
    return $class;
  }
  else {
    $type_definition = \Drupal::typedDataManager()
      ->getDefinition($this
      ->getItemDefinition()
      ->getDataType());
    return $type_definition['class'];
  }
}