You are here

protected function BaseFieldDefinition::getFieldItemClass in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Field/BaseFieldDefinition.php \Drupal\Core\Field\BaseFieldDefinition::getFieldItemClass()

Helper to retrieve the field item class.

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

3 calls to BaseFieldDefinition::getFieldItemClass()
BaseFieldDefinition::getMainPropertyName in core/lib/Drupal/Core/Field/BaseFieldDefinition.php
Returns the name of the main property, if any.
BaseFieldDefinition::getOptionsProvider in core/lib/Drupal/Core/Field/BaseFieldDefinition.php
Gets an options provider for the given field item property.
BaseFieldDefinition::getPropertyDefinitions in core/lib/Drupal/Core/Field/BaseFieldDefinition.php
Gets an array of property definitions of contained properties.

File

core/lib/Drupal/Core/Field/BaseFieldDefinition.php, line 570
Contains \Drupal\Core\Field\BaseFieldDefinition.

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