Commit cdac25ee authored by alexpott's avatar alexpott

Issue #2143263 by plopesc | yched: Remove "Field" prefix from FieldDefinitionInterface methods.

parent 1a80341d
......@@ -401,8 +401,9 @@ protected function getTranslatedField($name, $langcode) {
}
// Non-translatable fields are always stored with
// Language::LANGCODE_DEFAULT as key.
$default = $langcode == Language::LANGCODE_DEFAULT;
if (!$default && !$definition->isFieldTranslatable()) {
if (!$default && !$definition->isTranslatable()) {
if (!isset($this->fields[$name][Language::LANGCODE_DEFAULT])) {
$this->fields[$name][Language::LANGCODE_DEFAULT] = $this->getTranslatedField($name, Language::LANGCODE_DEFAULT);
}
......@@ -728,7 +729,7 @@ public function addTranslation($langcode, array $values = array()) {
$definitions = $translation->getPropertyDefinitions();
foreach ($values as $name => $value) {
if (isset($definitions[$name]) && $definitions[$name]->isFieldTranslatable()) {
if (isset($definitions[$name]) && $definitions[$name]->isTranslatable()) {
$translation->$name = $value;
}
}
......@@ -742,7 +743,7 @@ public function addTranslation($langcode, array $values = array()) {
public function removeTranslation($langcode) {
if (isset($this->translations[$langcode]) && $langcode != Language::LANGCODE_DEFAULT && $langcode != $this->defaultLangcode) {
foreach ($this->getPropertyDefinitions() as $name => $definition) {
if ($definition->isFieldTranslatable()) {
if ($definition->isTranslatable()) {
unset($this->values[$name][$langcode]);
unset($this->fields[$name][$langcode]);
}
......@@ -928,7 +929,7 @@ public function __clone() {
// object keyed by language. To avoid creating different field objects
// we retain just the original value, as references will be recreated
// later as needed.
if (!$definitions[$name]->isFieldTranslatable() && count($values) > 1) {
if (!$definitions[$name]->isTranslatable() && count($values) > 1) {
$values = array_intersect_key($values, array(Language::LANGCODE_DEFAULT => TRUE));
}
foreach ($values as $langcode => $items) {
......
......@@ -357,7 +357,7 @@ public function getFieldDefinitions($entity_type, $bundle = NULL) {
foreach (array('definitions', 'optional') as $key) {
foreach ($this->entityFieldInfo[$entity_type][$key] as $field_name => &$definition) {
if ($definition instanceof FieldDefinition) {
$definition->setFieldName($field_name);
$definition->setName($field_name);
}
}
}
......@@ -372,8 +372,8 @@ public function getFieldDefinitions($entity_type, $bundle = NULL) {
$untranslatable_fields = array_flip(array('langcode') + $keys);
foreach (array('definitions', 'optional') as $key) {
foreach ($this->entityFieldInfo[$entity_type][$key] as $field_name => &$definition) {
if (isset($untranslatable_fields[$field_name]) && $definition->isFieldTranslatable()) {
throw new \LogicException(format_string('The @field field cannot be translatable.', array('@field' => $definition->getFieldLabel())));
if (isset($untranslatable_fields[$field_name]) && $definition->isTranslatable()) {
throw new \LogicException(format_string('The @field field cannot be translatable.', array('@field' => $definition->getLabel())));
}
}
}
......
......@@ -917,14 +917,15 @@ protected function doLoadFieldItems($entities, $age) {
$delta_count = array();
foreach ($results as $row) {
// Ensure that records for non-translatable fields having invalid
// languages are skipped.
if ($row->langcode == $default_langcodes[$row->entity_id] || $field->isFieldTranslatable()) {
if ($row->langcode == $default_langcodes[$row->entity_id] || $field->isTranslatable()) {
if (!isset($delta_count[$row->entity_id][$row->langcode])) {
$delta_count[$row->entity_id][$row->langcode] = 0;
}
if ($field->getFieldCardinality() == FieldInterface::CARDINALITY_UNLIMITED || $delta_count[$row->entity_id][$row->langcode] < $field->getFieldCardinality()) {
if ($field->getCardinality() == FieldInterface::CARDINALITY_UNLIMITED || $delta_count[$row->entity_id][$row->langcode] < $field->getCardinality()) {
$item = array();
// For each column declared by the field, populate the item from the
// prefixed database column.
......@@ -987,7 +988,7 @@ protected function doSaveFieldItems(EntityInterface $entity, $update) {
$query = $this->database->insert($table_name)->fields($columns);
$revision_query = $this->database->insert($revision_name)->fields($columns);
$langcodes = $field->isFieldTranslatable() ? $translation_langcodes : array($default_langcode);
$langcodes = $field->isTranslatable() ? $translation_langcodes : array($default_langcode);
foreach ($langcodes as $langcode) {
$delta_count = 0;
$items = $entity->getTranslation($langcode)->get($field_name);
......@@ -1010,7 +1011,7 @@ protected function doSaveFieldItems(EntityInterface $entity, $update) {
$query->values($record);
$revision_query->values($record);
if ($field->getFieldCardinality() != FieldInterface::CARDINALITY_UNLIMITED && ++$delta_count == $field->getFieldCardinality()) {
if ($field->getCardinality() != FieldInterface::CARDINALITY_UNLIMITED && ++$delta_count == $field->getCardinality()) {
break;
}
}
......@@ -1279,12 +1280,12 @@ public function onFieldPurge(FieldInterface $field) {
*/
public static function _fieldSqlSchema(FieldInterface $field, array $schema = NULL) {
if ($field->deleted) {
$description_current = "Data storage for deleted field {$field->uuid()} ({$field->entity_type}, {$field->getFieldName()}).";
$description_revision = "Revision archive storage for deleted field {$field->uuid()} ({$field->entity_type}, {$field->getFieldName()}).";
$description_current = "Data storage for deleted field {$field->uuid()} ({$field->entity_type}, {$field->getName()}).";
$description_revision = "Revision archive storage for deleted field {$field->uuid()} ({$field->entity_type}, {$field->getName()}).";
}
else {
$description_current = "Data storage for {$field->entity_type} field {$field->getFieldName()}.";
$description_revision = "Revision archive storage for {$field->entity_type} field {$field->getFieldName()}.";
$description_current = "Data storage for {$field->entity_type} field {$field->getName()}.";
$description_revision = "Revision archive storage for {$field->entity_type} field {$field->getName()}.";
}
$current = array(
......@@ -1498,7 +1499,7 @@ static protected function _generateFieldTableName(FieldInterface $field, $revisi
* unique among all other fields.
*/
static public function _fieldIndexName(FieldInterface $field, $index) {
return $field->getFieldName() . '_' . $index;
return $field->getName() . '_' . $index;
}
/**
......@@ -1521,7 +1522,7 @@ static public function _fieldIndexName(FieldInterface $field, $index) {
* unique among all other fields.
*/
static public function _fieldColumnName(FieldInterface $field, $column) {
return in_array($column, Field::getReservedColumns()) ? $column : $field->getFieldName() . '_' . $column;
return in_array($column, Field::getReservedColumns()) ? $column : $field->getName() . '_' . $column;
}
}
......@@ -263,7 +263,7 @@ public function onBundleDelete($bundle) { }
*/
public function onFieldItemsPurge(EntityInterface $entity, FieldInstanceInterface $instance) {
if ($values = $this->readFieldItemsToPurge($entity, $instance)) {
$items = \Drupal::typedData()->create($instance, $values, $instance->getFieldName(), $entity);
$items = \Drupal::typedData()->create($instance, $values, $instance->getName(), $entity);
$items->delete();
}
$this->purgeFieldItems($entity, $instance);
......
......@@ -136,7 +136,7 @@ public function addField($field, $type, $langcode) {
// Get the field definitions form a mocked entity.
$values = array();
$field_name = $field->getFieldName();
$field_name = $field->getName();
// If there are bundles, pick one.
if (!empty($entity_info['entity_keys']['bundle'])) {
$values[$entity_info['entity_keys']['bundle']] = reset($field_map[$entity_type][$field_name]['bundles']);
......@@ -151,7 +151,7 @@ public function addField($field, $type, $langcode) {
// column, i.e. target_id or fid.
// Otherwise, the code executing the relationship will throw an
// exception anyways so no need to do it here.
if (!$column && isset($propertyDefinitions[$relationship_specifier]) && $entity->{$field->getFieldName()}->get('entity') instanceof EntityReference) {
if (!$column && isset($propertyDefinitions[$relationship_specifier]) && $entity->{$field->getName()}->get('entity') instanceof EntityReference) {
$column = current(array_keys($propertyDefinitions));
}
// Prepare the next index prefix.
......@@ -249,10 +249,10 @@ protected function ensureEntityTable($index_prefix, $property, $type, $langcode,
* @throws \Drupal\Core\Entity\Query\QueryException
*/
protected function ensureFieldTable($index_prefix, &$field, $type, $langcode, $base_table, $entity_id_field, $field_id_field) {
$field_name = $field->getFieldName();
$field_name = $field->getName();
if (!isset($this->fieldTables[$index_prefix . $field_name])) {
$table = $this->sqlQuery->getMetaData('age') == EntityStorageControllerInterface::FIELD_LOAD_CURRENT ? FieldableDatabaseStorageController::_fieldTableName($field) : FieldableDatabaseStorageController::_fieldRevisionTableName($field);
if ($field->getFieldCardinality() != 1) {
if ($field->getCardinality() != 1) {
$this->sqlQuery->addMetaData('simple_query', FALSE);
}
$entity_type = $this->sqlQuery->getMetaData('entity_type');
......
......@@ -64,13 +64,13 @@ public function getConstraints() {
// Check that the number of values doesn't exceed the field cardinality. For
// form submitted values, this can only happen with 'multiple value'
// widgets.
$cardinality = $this->getFieldDefinition()->getFieldCardinality();
$cardinality = $this->getFieldDefinition()->getCardinality();
if ($cardinality != FieldDefinitionInterface::CARDINALITY_UNLIMITED) {
$constraints[] = \Drupal::typedData()
->getValidationConstraintManager()
->create('Count', array(
'max' => $cardinality,
'maxMessage' => t('%name: this field cannot hold more than @count values.', array('%name' => $this->getFieldDefinition()->getFieldLabel(), '@count' => $cardinality)),
'maxMessage' => t('%name: this field cannot hold more than @count values.', array('%name' => $this->getFieldDefinition()->getLabel(), '@count' => $cardinality)),
));
}
......@@ -102,7 +102,7 @@ public function defaultValuesFormValidate(array $element, array &$form, array &$
if (count($violations)) {
// Store reported errors in $form_state.
$field_name = $this->getFieldDefinition()->getFieldName();
$field_name = $this->getFieldDefinition()->getName();
$field_state = field_form_get_state($element['#parents'], $field_name, $form_state);
$field_state['constraint_violations'] = $violations;
field_form_set_state($element['#parents'], $field_name, $form_state, $field_state);
......@@ -142,7 +142,7 @@ protected function defaultValueWidget(array &$form_state) {
// Use the widget currently configured for the 'default' form mode, or
// fallback to the default widget for the field type.
$entity_form_display = entity_get_form_display($entity->entityType(), $entity->bundle(), 'default');
$widget = $entity_form_display->getRenderer($this->getFieldDefinition()->getFieldName());
$widget = $entity_form_display->getRenderer($this->getFieldDefinition()->getName());
if (!$widget) {
$widget = \Drupal::service('plugin.manager.field.widget')->getInstance(array('field_definition' => $this->getFieldDefinition()));
}
......
......@@ -32,7 +32,7 @@ public static function create($type) {
/**
* {@inheritdoc}
*/
public function getFieldName() {
public function getName() {
return $this->definition['field_name'];
}
......@@ -45,7 +45,7 @@ public function getFieldName() {
* @return static
* The object itself for chaining.
*/
public function setFieldName($name) {
public function setName($name) {
$this->definition['field_name'] = $name;
return $this;
}
......@@ -53,7 +53,7 @@ public function setFieldName($name) {
/**
* {@inheritdoc}
*/
public function getFieldType() {
public function getType() {
$data_type = $this->getItemDefinition()->getDataType();
// Cut of the leading field_item: prefix from 'field_item:FIELD_TYPE'.
$parts = explode(':', $data_type);
......@@ -63,7 +63,7 @@ public function getFieldType() {
/**
* {@inheritdoc}
*/
public function getFieldSettings() {
public function getSettings() {
return $this->getItemDefinition()->getSettings();
}
......@@ -76,7 +76,7 @@ public function getFieldSettings() {
* @return static
* The object itself for chaining.
*/
public function setFieldSettings(array $settings) {
public function setSettings(array $settings) {
$this->getItemDefinition()->setSettings($settings);
return $this;
}
......@@ -84,7 +84,7 @@ public function setFieldSettings(array $settings) {
/**
* {@inheritdoc}
*/
public function getFieldSetting($setting_name) {
public function getSetting($setting_name) {
return $this->getItemDefinition()->getSetting($setting_name);
}
......@@ -99,7 +99,7 @@ public function getFieldSetting($setting_name) {
* @return static
* The object itself for chaining.
*/
public function setFieldSetting($setting_name, $value) {
public function setSetting($setting_name, $value) {
$this->getItemDefinition()->setSetting($setting_name, $value);
return $this;
}
......@@ -107,14 +107,14 @@ public function setFieldSetting($setting_name, $value) {
/**
* {@inheritdoc}
*/
public function getFieldPropertyNames() {
public function getPropertyNames() {
return array_keys(\Drupal::typedData()->create($this->getItemDefinition())->getPropertyDefinitions());
}
/**
* {@inheritdoc}
*/
public function isFieldTranslatable() {
public function isTranslatable() {
return !empty($this->definition['translatable']);
}
......@@ -135,35 +135,7 @@ public function setTranslatable($translatable) {
/**
* {@inheritdoc}
*/
public function getFieldLabel() {
return $this->getLabel();
}
/**
* {@inheritdoc}
*/
public function setFieldLabel($label) {
return $this->setLabel($label);
}
/**
* {@inheritdoc}
*/
public function getFieldDescription() {
return $this->getDescription();
}
/**
* {@inheritdoc}
*/
public function setFieldDescription($description) {
return $this->setDescription($description);
}
/**
* {@inheritdoc}
*/
public function getFieldCardinality() {
public function getCardinality() {
// @todo: Allow to control this.
return isset($this->definition['cardinality']) ? $this->definition['cardinality'] : 1;
}
......@@ -171,35 +143,15 @@ public function getFieldCardinality() {
/**
* {@inheritdoc}
*/
public function isFieldRequired() {
return $this->isRequired();
}
/**
* {@inheritdoc}
*/
public function isFieldMultiple() {
$cardinality = $this->getFieldCardinality();
public function isMultiple() {
$cardinality = $this->getCardinality();
return ($cardinality == static::CARDINALITY_UNLIMITED) || ($cardinality > 1);
}
/**
* Sets whether the field is required.
*
* @param bool $required
* Whether the field is required.
*
* @return static
* The object itself for chaining.
*/
public function setFieldRequired($required) {
return $this->setRequired($required);
}
/**
* {@inheritdoc}
*/
public function isFieldQueryable() {
public function isQueryable() {
return isset($this->definition['queryable']) ? $this->definition['queryable'] : !$this->isComputed();
}
......@@ -212,7 +164,7 @@ public function isFieldQueryable() {
* @return static
* The object itself for chaining.
*/
public function setFieldQueryable($queryable) {
public function setQueryable($queryable) {
$this->definition['queryable'] = $queryable;
return $this;
}
......@@ -238,15 +190,15 @@ public function setPropertyConstraints($name, array $constraints) {
/**
* {@inheritdoc}
*/
public function isFieldConfigurable() {
public function isConfigurable() {
return FALSE;
}
/**
* {@inheritdoc}
*/
public function getFieldDefaultValue(EntityInterface $entity) {
return $this->getFieldSetting('default_value');
public function getDefaultValue(EntityInterface $entity) {
return $this->getSetting('default_value');
}
}
......@@ -67,7 +67,7 @@ interface FieldDefinitionInterface extends ListDefinitionInterface {
* @return string
* The field name.
*/
public function getFieldName();
public function getName();
/**
* Returns the field type.
......@@ -77,7 +77,7 @@ public function getFieldName();
*
* @see \Drupal\Core\Field\FieldTypePluginManager
*/
public function getFieldType();
public function getType();
/**
* Returns the field settings.
......@@ -89,7 +89,7 @@ public function getFieldType();
* @return array
* An array of key/value pairs.
*/
public function getFieldSettings();
public function getSettings();
/**
* Returns the value of a given field setting.
......@@ -100,7 +100,7 @@ public function getFieldSettings();
* @return mixed
* The setting value.
*/
public function getFieldSetting($setting_name);
public function getSetting($setting_name);
/**
* Returns the names of the field's subproperties.
......@@ -116,7 +116,7 @@ public function getFieldSetting($setting_name);
* @return array
* The property names.
*/
public function getFieldPropertyNames();
public function getPropertyNames();
/**
* Returns whether the field is translatable.
......@@ -124,7 +124,7 @@ public function getFieldPropertyNames();
* @return bool
* TRUE if the field is translatable.
*/
public function isFieldTranslatable();
public function isTranslatable();
/**
* Determines whether the field is configurable via field.module.
......@@ -132,7 +132,7 @@ public function isFieldTranslatable();
* @return bool
* TRUE if the field is configurable.
*/
public function isFieldConfigurable();
public function isConfigurable();
/**
* Determines whether the field is queryable via QueryInterface.
......@@ -140,7 +140,7 @@ public function isFieldConfigurable();
* @return bool
* TRUE if the field is queryable.
*/
public function isFieldQueryable();
public function isQueryable();
/**
* Returns the human-readable label for the field.
......@@ -148,7 +148,7 @@ public function isFieldQueryable();
* @return string
* The field label.
*/
public function getFieldLabel();
public function getLabel();
/**
* Returns the human-readable description for the field.
......@@ -160,7 +160,7 @@ public function getFieldLabel();
* @return string|null
* The field description, or NULL if no description is available.
*/
public function getFieldDescription();
public function getDescription();
/**
* Returns the maximum number of items allowed for the field.
......@@ -171,7 +171,7 @@ public function getFieldDescription();
* @return integer
* The field cardinality.
*/
public function getFieldCardinality();
public function getCardinality();
/**
* Returns whether at least one non-empty item is required for this field.
......@@ -182,7 +182,7 @@ public function getFieldCardinality();
* @return bool
* TRUE if the field is required.
*/
public function isFieldRequired();
public function isRequired();
/**
* Returns whether the field can contain multiple items.
......@@ -190,7 +190,7 @@ public function isFieldRequired();
* @return bool
* TRUE if the field can contain multiple items, FALSE otherwise.
*/
public function isFieldMultiple();
public function isMultiple();
/**
* Returns the default value for the field in a newly created entity.
......@@ -207,6 +207,6 @@ public function isFieldMultiple();
* array.
* - NULL or array() for no default value.
*/
public function getFieldDefaultValue(EntityInterface $entity);
public function getDefaultValue(EntityInterface $entity);
}
......@@ -65,7 +65,7 @@ public function getFieldDefinition() {
* The array of settings.
*/
protected function getFieldSettings() {
return $this->getFieldDefinition()->getFieldSettings();
return $this->getFieldDefinition()->getSettings();
}
/**
......@@ -78,7 +78,7 @@ protected function getFieldSettings() {
* The setting value.
*/
protected function getFieldSetting($setting_name) {
return $this->getFieldDefinition()->getFieldSetting($setting_name);
return $this->getFieldDefinition()->getSetting($setting_name);
}
/**
......
......@@ -230,7 +230,7 @@ public function applyDefaultValue($notify = TRUE) {
* The default value for the field.
*/
protected function getDefaultValue() {
return $this->getFieldDefinition()->getFieldDefaultValue($this->getEntity());
return $this->getFieldDefinition()->getDefaultValue($this->getEntity());
}
/**
......
......@@ -75,17 +75,17 @@ public function view(FieldItemListInterface $items) {
if ($elements) {
$entity = $items->getEntity();
$entity_type = $entity->entityType();
$field_name = $this->fieldDefinition->getFieldName();
$field_name = $this->fieldDefinition->getName();
$info = array(
'#theme' => 'field',
'#title' => $this->fieldDefinition->getFieldLabel(),
'#title' => $this->fieldDefinition->getLabel(),
'#access' => $items->access('view'),
'#label_display' => $this->label,
'#view_mode' => $this->viewMode,
'#language' => $items->getLangcode(),
'#field_name' => $field_name,
'#field_type' => $this->fieldDefinition->getFieldType(),
'#field_translatable' => $this->fieldDefinition->isFieldTranslatable(),
'#field_type' => $this->fieldDefinition->getType(),
'#field_translatable' => $this->fieldDefinition->isTranslatable(),
'#entity_type' => $entity_type,
'#bundle' => $entity->bundle(),
'#object' => $entity,
......@@ -138,7 +138,7 @@ public function prepareView(array $entities_items) { }
* The array of settings.
*/
protected function getFieldSettings() {
return $this->fieldDefinition->getFieldSettings();
return $this->fieldDefinition->getSettings();
}
/**
......@@ -151,7 +151,7 @@ protected function getFieldSettings() {
* The setting value.
*/
protected function getFieldSetting($setting_name) {
return $this->fieldDefinition->getFieldSetting($setting_name);
return $this->fieldDefinition->getSetting($setting_name);
}
}
......@@ -101,7 +101,7 @@ public function createInstance($plugin_id, array $configuration) {
public function getInstance(array $options) {
$configuration = $options['configuration'];
$field_definition = $options['field_definition'];
$field_type = $field_definition->getFieldType();
$field_type = $field_definition->getType();
// Fill in default configuration if needed.
if (!isset($options['prepare']) || $options['prepare'] == TRUE) {
......
......@@ -51,7 +51,7 @@ public function isEmpty() {
$item = $this->getValue(TRUE);
// The previous hook was never called on an empty item, but
// ContentEntityBase always creates a FieldItem element for an empty field.
return empty($item) || $callback($item, $this->getFieldDefinition()->getFieldType());
return empty($item) || $callback($item, $this->getFieldDefinition()->getType());
}
/**
......
......@@ -40,14 +40,14 @@ public function validate() {
$this->legacyCallback('validate', array(&$legacy_errors));
$langcode = $this->getLangcode();
$field_name = $this->getFieldDefinition()->getFieldName();
$field_name = $this->getFieldDefinition()->getName();
if (isset($legacy_errors[$field_name][$langcode])) {
foreach ($legacy_errors[$field_name][$langcode] as $delta => $item_errors) {
foreach ($item_errors as $item_error) {
// We do not have the information about which column triggered the
// error, so assume the first column...
$property_names = $this->getFieldDefinition()->getFieldPropertyNames();
$property_names = $this->getFieldDefinition()->getPropertyNames();
$property_name = $property_names[0];
$violations->add(new ConstraintViolation($item_error['message'], $item_error['message'], array(), $this, $delta . '.' . $property_name, $this->offsetGet($delta)->get($property_name)->getValue(), NULL, $item_error['error']));
}
......@@ -102,7 +102,7 @@ public function deleteRevision() {
* The name of the hook, e.g. 'presave', 'validate'.
*/
protected function legacyCallback($hook, $args = array()) {
$type_definition = \Drupal::service('plugin.manager.field.field_type')->getDefinition($this->getFieldDefinition()->getFieldType());
$type_definition = \Drupal::service('plugin.manager.field.field_type')->getDefinition($this->getFieldDefinition()->getType());
$module = $type_definition['provider'];
$callback = "{$module}_field_{$hook}";
if (function_exists($callback)) {
......
......@@ -51,7 +51,7 @@ public function __construct($plugin_id, array $plugin_definition, FieldDefinitio
* {@inheritdoc}
*/
public function form(FieldItemListInterface $items, array &$form, array &$form_state, $get_delta = NULL) {
$field_name = $this->fieldDefinition->getFieldName();
$field_name = $this->fieldDefinition->getName();
$parents = $form['#parents'];
// Store field information in $form_state.
......@@ -74,8 +74,8 @@ public function form(FieldItemListInterface $items, array &$form, array &$form_s
if (isset($get_delta) || $definition['multiple_values']) {
$delta = isset($get_delta) ? $get_delta : 0;
$element = array(
'#title' => check_plain($this->fieldDefinition->getFieldLabel()),
'#description' => field_filter_xss(\Drupal::token()->replace($this->fieldDefinition->getFieldDescription())),
'#title' => check_plain($this->fieldDefinition->getLabel()),
'#description' => field_filter_xss(\Drupal::token()->replace($this->fieldDefinition->getDescription())),
);
$element = $this->formSingleElement($items, $delta, $element, $form, $form_state);
......@@ -118,7 +118,7 @@ public function form(FieldItemListInterface $items, array &$form, array &$form_s
'#parents' => array_merge($parents, array($field_name . '_wrapper')),
'#attributes' => array(
'class' => array(
'field-type-' . drupal_html_class($this->fieldDefinition->getFieldType()),