Commit 01457d74 authored by webchick's avatar webchick

Issue #2200821 by yched, plopesc, Berdir, claudiu.cristea, swentel: Rename...

Issue #2200821 by yched, plopesc, Berdir, claudiu.cristea, swentel: Rename Fieldinterface and FieldInstanceInterface.
parent f19fadd3
......@@ -16,8 +16,8 @@
use Drupal\Component\Uuid\Uuid;
use Drupal\field\FieldInfo;
use Drupal\field\FieldUpdateForbiddenException;
use Drupal\field\FieldInterface;
use Drupal\field\FieldInstanceInterface;
use Drupal\field\FieldConfigInterface;
use Drupal\field\FieldInstanceConfigInterface;
use Drupal\field\Entity\FieldConfig;
use Symfony\Component\DependencyInjection\ContainerInterface;
......
......@@ -15,8 +15,8 @@
use Drupal\Component\Uuid\Uuid;
use Drupal\field\FieldInfo;
use Drupal\field\FieldUpdateForbiddenException;
use Drupal\field\FieldInterface;
use Drupal\field\FieldInstanceInterface;
use Drupal\field\FieldConfigInterface;
use Drupal\field\FieldInstanceConfigInterface;
use Drupal\field\Entity\FieldConfig;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -820,7 +820,7 @@ protected function doLoadFieldItems($entities, $age) {
$delta_count[$row->entity_id][$row->langcode] = 0;
}
if ($field->getCardinality() == FieldInterface::CARDINALITY_UNLIMITED || $delta_count[$row->entity_id][$row->langcode] < $field->getCardinality()) {
if ($field->getCardinality() == FieldConfigInterface::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.
......@@ -906,7 +906,7 @@ protected function doSaveFieldItems(EntityInterface $entity, $update) {
$query->values($record);
$revision_query->values($record);
if ($field->getCardinality() != FieldInterface::CARDINALITY_UNLIMITED && ++$delta_count == $field->getCardinality()) {
if ($field->getCardinality() != FieldConfigInterface::CARDINALITY_UNLIMITED && ++$delta_count == $field->getCardinality()) {
break;
}
}
......@@ -960,7 +960,7 @@ protected function doDeleteFieldItemsRevision(EntityInterface $entity) {
/**
* {@inheritdoc}
*/
public function onFieldCreate(FieldInterface $field) {
public function onFieldCreate(FieldConfigInterface $field) {
$schema = $this->_fieldSqlSchema($field);
foreach ($schema as $name => $table) {
$this->database->schema()->createTable($name, $table);
......@@ -970,7 +970,7 @@ public function onFieldCreate(FieldInterface $field) {
/**
* {@inheritdoc}
*/
public function onFieldUpdate(FieldInterface $field) {
public function onFieldUpdate(FieldConfigInterface $field) {
$original = $field->original;
if (!$field->hasData()) {
......@@ -1057,7 +1057,7 @@ public function onFieldUpdate(FieldInterface $field) {
/**
* {@inheritdoc}
*/
public function onFieldDelete(FieldInterface $field) {
public function onFieldDelete(FieldConfigInterface $field) {
// Mark all data associated with the field for deletion.
$table = static::_fieldTableName($field);
$revision_table = static::_fieldRevisionTableName($field);
......@@ -1078,7 +1078,7 @@ public function onFieldDelete(FieldInterface $field) {
/**
* {@inheritdoc}
*/
public function onInstanceDelete(FieldInstanceInterface $instance) {
public function onInstanceDelete(FieldInstanceConfigInterface $instance) {
$field = $instance->getField();
$table_name = static::_fieldTableName($field);
$revision_name = static::_fieldRevisionTableName($field);
......@@ -1118,7 +1118,7 @@ public function onBundleRename($bundle, $bundle_new) {
/**
* {@inheritdoc}
*/
protected function readFieldItemsToPurge(EntityInterface $entity, FieldInstanceInterface $instance) {
protected function readFieldItemsToPurge(EntityInterface $entity, FieldInstanceConfigInterface $instance) {
$field = $instance->getField();
$table_name = static::_fieldTableName($field);
$query = $this->database->select($table_name, 't', array('fetch' => \PDO::FETCH_ASSOC))
......@@ -1133,7 +1133,7 @@ protected function readFieldItemsToPurge(EntityInterface $entity, FieldInstanceI
/**
* {@inheritdoc}
*/
public function purgeFieldItems(EntityInterface $entity, FieldInstanceInterface $instance) {
public function purgeFieldItems(EntityInterface $entity, FieldInstanceConfigInterface $instance) {
$field = $instance->getField();
$table_name = static::_fieldTableName($field);
$revision_name = static::_fieldRevisionTableName($field);
......@@ -1148,7 +1148,7 @@ public function purgeFieldItems(EntityInterface $entity, FieldInstanceInterface
/**
* {@inheritdoc}
*/
public function onFieldPurge(FieldInterface $field) {
public function onFieldPurge(FieldConfigInterface $field) {
$table_name = static::_fieldTableName($field);
$revision_name = static::_fieldRevisionTableName($field);
$this->database->schema()->dropTable($table_name);
......@@ -1162,7 +1162,7 @@ public function onFieldPurge(FieldInterface $field) {
* strongly discouraged. This function is not considered part of the public
* API and modules relying on it might break even in minor releases.
*
* @param \Drupal\field\FieldInterface $field
* @param \Drupal\field\FieldConfigInterface $field
* The field object
* @param array $schema
* The field schema array. Mandatory for upgrades, omit otherwise.
......@@ -1173,7 +1173,7 @@ public function onFieldPurge(FieldInterface $field) {
*
* @see hook_schema()
*/
public static function _fieldSqlSchema(FieldInterface $field, array $schema = NULL) {
public static function _fieldSqlSchema(FieldConfigInterface $field, array $schema = NULL) {
if ($field->deleted) {
$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()}).";
......@@ -1331,14 +1331,14 @@ public static function _fieldSqlSchema(FieldInterface $field, array $schema = NU
* support. Always call entity_load() before using the data found in the
* table.
*
* @param \Drupal\field\FieldInterface $field
* @param \Drupal\field\FieldConfigInterface $field
* The field object.
*
* @return string
* A string containing the generated name for the database table.
*
*/
static public function _fieldTableName(FieldInterface $field) {
static public function _fieldTableName(FieldConfigInterface $field) {
if ($field->deleted) {
// When a field is a deleted, the table is renamed to
// {field_deleted_data_FIELD_UUID}. To make sure we don't end up with
......@@ -1361,13 +1361,13 @@ static public function _fieldTableName(FieldInterface $field) {
* support. Always call entity_load() before using the data found in the
* table.
*
* @param \Drupal\field\FieldInterface $field
* @param \Drupal\field\FieldConfigInterface $field
* The field object.
*
* @return string
* A string containing the generated name for the database table.
*/
static public function _fieldRevisionTableName(FieldInterface $field) {
static public function _fieldRevisionTableName(FieldConfigInterface $field) {
if ($field->deleted) {
// When a field is a deleted, the table is renamed to
// {field_deleted_revision_FIELD_UUID}. To make sure we don't end up with
......@@ -1386,7 +1386,7 @@ static public function _fieldRevisionTableName(FieldInterface $field) {
* The method accounts for a maximum table name length of 64 characters, and
* takes care of disambiguation.
*
* @param \Drupal\field\FieldInterface $field
* @param \Drupal\field\FieldConfigInterface $field
* The field object.
* @param bool $revision
* TRUE for revision table, FALSE otherwise.
......@@ -1394,7 +1394,7 @@ static public function _fieldRevisionTableName(FieldInterface $field) {
* @return string
* The final table name.
*/
static protected function _generateFieldTableName(FieldInterface $field, $revision) {
static protected function _generateFieldTableName(FieldConfigInterface $field, $revision) {
$separator = $revision ? '_revision__' : '__';
$table_name = $field->entity_type . $separator . $field->name;
// Limit the string to 48 characters, keeping a 16 characters margin for db
......@@ -1418,7 +1418,7 @@ static protected function _generateFieldTableName(FieldInterface $field, $revisi
* strongly discouraged. This function is not considered part of the public
* API and modules relying on it might break even in minor releases.
*
* @param \Drupal\field\FieldInterface $field
* @param \Drupal\field\FieldConfigInterface $field
* The field structure
* @param string $index
* The name of the index.
......@@ -1427,7 +1427,7 @@ static protected function _generateFieldTableName(FieldInterface $field, $revisi
* A string containing a generated index name for a field data table that is
* unique among all other fields.
*/
static public function _fieldIndexName(FieldInterface $field, $index) {
static public function _fieldIndexName(FieldConfigInterface $field, $index) {
return $field->getName() . '_' . $index;
}
......@@ -1441,7 +1441,7 @@ static public function _fieldIndexName(FieldInterface $field, $index) {
* support. Always call entity_load() before using the data found in the
* table.
*
* @param \Drupal\field\FieldInterface $field
* @param \Drupal\field\FieldConfigInterface $field
* The field object.
* @param string $column
* The name of the column.
......@@ -1450,7 +1450,7 @@ static public function _fieldIndexName(FieldInterface $field, $index) {
* A string containing a generated column name for a field data table that is
* unique among all other fields.
*/
static public function _fieldColumnName(FieldInterface $field, $column) {
static public function _fieldColumnName(FieldConfigInterface $field, $column) {
return in_array($column, FieldConfig::getReservedColumns()) ? $column : $field->getName() . '_' . $column;
}
......
......@@ -9,8 +9,8 @@
use Drupal\Component\Utility\String;
use Drupal\Core\Field\PrepareCacheInterface;
use Drupal\field\FieldInterface;
use Drupal\field\FieldInstanceInterface;
use Drupal\field\FieldConfigInterface;
use Drupal\field\FieldInstanceConfigInterface;
use Drupal\Core\Field\ConfigFieldItemListInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -295,32 +295,32 @@ protected function deleteFieldItemsRevision(EntityInterface $entity) {
/**
* {@inheritdoc}
*/
public function onFieldCreate(FieldInterface $field) { }
public function onFieldCreate(FieldConfigInterface $field) { }
/**
* {@inheritdoc}
*/
public function onFieldUpdate(FieldInterface $field) { }
public function onFieldUpdate(FieldConfigInterface $field) { }
/**
* {@inheritdoc}
*/
public function onFieldDelete(FieldInterface $field) { }
public function onFieldDelete(FieldConfigInterface $field) { }
/**
* {@inheritdoc}
*/
public function onInstanceCreate(FieldInstanceInterface $instance) { }
public function onInstanceCreate(FieldInstanceConfigInterface $instance) { }
/**
* {@inheritdoc}
*/
public function onInstanceUpdate(FieldInstanceInterface $instance) { }
public function onInstanceUpdate(FieldInstanceConfigInterface $instance) { }
/**
* {@inheritdoc}
*/
public function onInstanceDelete(FieldInstanceInterface $instance) { }
public function onInstanceDelete(FieldInstanceConfigInterface $instance) { }
/**
* {@inheritdoc}
......@@ -340,7 +340,7 @@ public function onBundleDelete($bundle) { }
/**
* {@inheritdoc}
*/
public function onFieldItemsPurge(EntityInterface $entity, FieldInstanceInterface $instance) {
public function onFieldItemsPurge(EntityInterface $entity, FieldInstanceConfigInterface $instance) {
if ($values = $this->readFieldItemsToPurge($entity, $instance)) {
$items = \Drupal::typedDataManager()->create($instance, $values, $instance->getName(), $entity);
$items->delete();
......@@ -356,29 +356,29 @@ public function onFieldItemsPurge(EntityInterface $entity, FieldInstanceInterfac
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity.
* @param \Drupal\field\FieldInstanceInterface $instance
* @param \Drupal\field\FieldInstanceConfigInterface $instance
* The field instance.
*
* @return array
* The field values, in their canonical array format (numerically indexed
* array of items, each item being a property/value array).
*/
abstract protected function readFieldItemsToPurge(EntityInterface $entity, FieldInstanceInterface $instance);
abstract protected function readFieldItemsToPurge(EntityInterface $entity, FieldInstanceConfigInterface $instance);
/**
* Removes field data from storage during purge.
*
* @param EntityInterface $entity
* The entity whose values are being purged.
* @param FieldInstanceInterface $instance
* @param FieldInstanceConfigInterface $instance
* The field whose values are bing purged.
*/
abstract protected function purgeFieldItems(EntityInterface $entity, FieldInstanceInterface $instance);
abstract protected function purgeFieldItems(EntityInterface $entity, FieldInstanceConfigInterface $instance);
/**
* {@inheritdoc}
*/
public function onFieldPurge(FieldInterface $field) { }
public function onFieldPurge(FieldConfigInterface $field) { }
/**
* Checks translation statuses and invoke the related hooks if needed.
......
......@@ -7,26 +7,26 @@
namespace Drupal\Core\Entity;
use Drupal\field\FieldInterface;
use Drupal\field\FieldInstanceInterface;
use Drupal\field\FieldConfigInterface;
use Drupal\field\FieldInstanceConfigInterface;
interface FieldableEntityStorageControllerInterface extends EntityStorageControllerInterface {
/**
* Allows reaction to the creation of a configurable field.
*
* @param \Drupal\field\FieldInterface $field
* @param \Drupal\field\FieldConfigInterface $field
* The field being created.
*/
public function onFieldCreate(FieldInterface $field);
public function onFieldCreate(FieldConfigInterface $field);
/**
* Allows reaction to the update of a configurable field.
*
* @param \Drupal\field\FieldInterface $field
* @param \Drupal\field\FieldConfigInterface $field
* The field being updated.
*/
public function onFieldUpdate(FieldInterface $field);
public function onFieldUpdate(FieldConfigInterface $field);
/**
* Allows reaction to the deletion of a configurable field.
......@@ -34,28 +34,28 @@ public function onFieldUpdate(FieldInterface $field);
* Stored values should not be wiped at once, but marked as 'deleted' so that
* they can go through a proper purge process later on.
*
* @param \Drupal\field\FieldInterface $field
* @param \Drupal\field\FieldConfigInterface $field
* The field being deleted.
*
* @see fieldPurgeData()
*/
public function onFieldDelete(FieldInterface $field);
public function onFieldDelete(FieldConfigInterface $field);
/**
* Allows reaction to the creation of a configurable field instance.
*
* @param \Drupal\field\FieldInstanceInterface $instance
* @param \Drupal\field\FieldInstanceConfigInterface $instance
* The instance being created.
*/
public function onInstanceCreate(FieldInstanceInterface $instance);
public function onInstanceCreate(FieldInstanceConfigInterface $instance);
/**
* Allows reaction to the update of a configurable field instance.
*
* @param \Drupal\field\FieldInstanceInterface $instance
* @param \Drupal\field\FieldInstanceConfigInterface $instance
* The instance being updated.
*/
public function onInstanceUpdate(FieldInstanceInterface $instance);
public function onInstanceUpdate(FieldInstanceConfigInterface $instance);
/**
* Allows reaction to the deletion of a configurable field instance.
......@@ -63,12 +63,12 @@ public function onInstanceUpdate(FieldInstanceInterface $instance);
* Stored values should not be wiped at once, but marked as 'deleted' so that
* they can go through a proper purge process later on.
*
* @param \Drupal\field\FieldInstanceInterface $instance
* @param \Drupal\field\FieldInstanceConfigInterface $instance
* The instance being deleted.
*
* @see fieldPurgeData()
*/
public function onInstanceDelete(FieldInstanceInterface $instance);
public function onInstanceDelete(FieldInstanceConfigInterface $instance);
/**
* Allows reaction to a bundle being created.
......@@ -109,17 +109,17 @@ public function onBundleDelete($bundle);
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity whose field data is being purged.
* @param \Drupal\field\FieldInstanceInterface $instance
* @param \Drupal\field\FieldInstanceConfigInterface $instance
* The deleted field instance whose data is being purged.
*/
public function onFieldItemsPurge(EntityInterface $entity, FieldInstanceInterface $instance);
public function onFieldItemsPurge(EntityInterface $entity, FieldInstanceConfigInterface $instance);
/**
* Performs final cleanup after all data on all instances has been purged.
*
* @param \Drupal\field\FieldInterface $instance
* @param \Drupal\field\FieldConfigInterface $instance
* The field being purged.
*/
public function onFieldPurge(FieldInterface $field);
public function onFieldPurge(FieldConfigInterface $field);
}
......@@ -8,7 +8,7 @@
namespace Drupal\Core\Entity;
use Drupal\Core\Entity\Query\QueryException;
use Drupal\field\FieldInstanceInterface;
use Drupal\field\FieldInstanceConfigInterface;
/**
* Defines a null entity controller class.
......@@ -97,13 +97,13 @@ protected function doDeleteFieldItemsRevision(EntityInterface $entity) {
/**
* {@inheritdoc}
*/
protected function readFieldItemsToPurge(EntityInterface $entity, FieldInstanceInterface $instance) {
protected function readFieldItemsToPurge(EntityInterface $entity, FieldInstanceConfigInterface $instance) {
}
/**
* {@inheritdoc}
*/
protected function purgeFieldItems(EntityInterface $entity, FieldInstanceInterface $instance) {
protected function purgeFieldItems(EntityInterface $entity, FieldInstanceConfigInterface $instance) {
}
}
......@@ -7,7 +7,7 @@
namespace Drupal\Core\Field;
use Drupal\field\FieldInstanceInterface;
use Drupal\field\FieldInstanceConfigInterface;
use Drupal\Core\TypedData\TypedDataInterface;
use Drupal\field\Field;
......@@ -19,7 +19,7 @@ class ConfigFieldItemList extends FieldItemList implements ConfigFieldItemListIn
/**
* The Field instance definition.
*
* @var \Drupal\field\FieldInstanceInterface
* @var \Drupal\field\FieldInstanceConfigInterface
*/
protected $instance;
......@@ -29,7 +29,7 @@ class ConfigFieldItemList extends FieldItemList implements ConfigFieldItemListIn
public function __construct($definition, $name = NULL, TypedDataInterface $parent = NULL) {
parent::__construct($definition, $name, $parent);
// Definition can be the field config or field instance.
if ($definition instanceof FieldInstanceInterface) {
if ($definition instanceof FieldInstanceConfigInterface) {
$this->instance = $definition;
}
}
......
......@@ -300,7 +300,7 @@ public function getSchema();
* The array of field columns, keyed by column name, in the same format
* returned by getSchema().
*
* @see \Drupal\field\Entity\FieldInterface::getSchema()
* @see \Drupal\Core\Field\FieldDefinitionInterface::getSchema()
*/
public function getColumns();
......
......@@ -14,8 +14,8 @@
use Drupal\Core\Entity\EntityChangedInterface;
use Drupal\comment\CommentInterface;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\field\FieldInstanceInterface;
use Drupal\field\FieldInterface;
use Drupal\field\FieldInstanceConfigInterface;
use Drupal\field\FieldConfigInterface;
use Drupal\file\FileInterface;
use Drupal\user\EntityOwnerInterface;
......@@ -238,7 +238,7 @@ function comment_count_unpublished() {
/**
* Implements hook_ENTITY_TYPE_insert() for 'field_instance_config'.
*/
function comment_field_instance_config_insert(FieldInstanceInterface $instance) {
function comment_field_instance_config_insert(FieldInstanceConfigInterface $instance) {
if ($instance->getType() == 'comment' && !$instance->isSyncing()) {
\Drupal::service('comment.manager')->addBodyField($instance->entity_type, $instance->getName());
\Drupal::cache()->delete('comment_entity_info');
......@@ -248,7 +248,7 @@ function comment_field_instance_config_insert(FieldInstanceInterface $instance)
/**
* Implements hook_ENTITY_TYPE_create() for 'field_instance_config'.
*/
function comment_field_instance_config_create(FieldInstanceInterface $instance) {
function comment_field_instance_config_create(FieldInstanceConfigInterface $instance) {
if ($instance->getType() == 'comment' && !$instance->isSyncing()) {
// Assign default values for the field instance.
if (!isset($instance->default_value)) {
......@@ -269,7 +269,7 @@ function comment_field_instance_config_create(FieldInstanceInterface $instance)
/**
* Implements hook_ENTITY_TYPE_update() for 'field_instance_config'.
*/
function comment_field_instance_config_update(FieldInstanceInterface $instance) {
function comment_field_instance_config_update(FieldInstanceConfigInterface $instance) {
if ($instance->getType() == 'comment') {
\Drupal::entityManager()->getViewBuilder($instance->entity_type)->resetCache();
// Comment field settings also affects the rendering of *comment* entities,
......@@ -281,7 +281,7 @@ function comment_field_instance_config_update(FieldInstanceInterface $instance)
/**
* Implements hook_ENTITY_TYPE_delete() for 'field_config'.
*/
function comment_field_config_delete(FieldInterface $field) {
function comment_field_config_delete(FieldConfigInterface $field) {
if ($field->getType() == 'comment') {
// Delete all fields and displays attached to the comment bundle.
entity_invoke_bundle_hook('delete', 'comment', $field->getName());
......@@ -292,7 +292,7 @@ function comment_field_config_delete(FieldInterface $field) {
/**
* Implements hook_ENTITY_TYPE_delete() for 'field_instance_config'.
*/
function comment_field_instance_config_delete(FieldInstanceInterface $instance) {
function comment_field_instance_config_delete(FieldInstanceConfigInterface $instance) {
if ($instance->getType() == 'comment') {
// Delete all comments that used by the entity bundle.
$comments = db_query("SELECT cid FROM {comment} WHERE entity_type = :entity_type AND field_id = :field_id", array(
......
......@@ -21,7 +21,7 @@ class ConfigFieldInstanceMapper extends ConfigEntityMapper {
/**
* Loaded entity instance to help produce the translation interface.
*
* @var \Drupal\field\FieldInstanceInterface
* @var \Drupal\field\FieldInstanceConfigInterface
*/
protected $entity;
......
......@@ -12,7 +12,7 @@
use Drupal\Core\Access\AccessCheckInterface;
use Drupal\edit\Access\EditEntityFieldAccessCheck;
use Drupal\Tests\UnitTestCase;
use Drupal\field\FieldInterface;
use Drupal\field\FieldConfigInterface;
use Drupal\Core\Language\Language;
use Drupal\Core\Entity\EntityInterface;
......@@ -110,14 +110,14 @@ public function providerTestAccess() {
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* A mocked entity.
* @param \Drupal\field\FieldInterface $field
* @param \Drupal\field\FieldConfigInterface $field
* A mocked field.
* @param bool|null $expected_result
* The expected result of the access call.
*
* @dataProvider providerTestAccess
*/
public function testAccess(EntityInterface $entity, FieldInterface $field = NULL, $expected_result) {
public function testAccess(EntityInterface $entity, FieldConfigInterface $field = NULL, $expected_result) {
$route = new Route('/edit/form/test_entity/1/body/und/full', array(), array('_access_edit_entity_field' => 'TRUE'));
$request = new Request();
......
......@@ -9,7 +9,7 @@
use Drupal\Core\Database\Query\AlterableInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\field\FieldInterface;
use Drupal\field\FieldConfigInterface;
/**
* Implements hook_help().
......@@ -68,7 +68,7 @@ function entity_reference_field_widget_info_alter(&$info) {
*
* Reset the instance handler settings, when the target type is changed.
*/
function entity_reference_field_config_update(FieldInterface $field) {
function entity_reference_field_config_update(FieldConfigInterface $field) {
if ($field->type != 'entity_reference') {
// Only act on entity reference fields.
return;
......
......@@ -52,7 +52,7 @@ function field_info_field_map() {
* non-deleted field. For deleted fields, use field_info_field_by_id().
*
* @return
* The \Drupal\field\FieldInterface field definition, as returned by
* The \Drupal\field\FieldConfigInterface field definition, as returned by
* entity_load_multiple_by_properties(), NULL if the field was not found.
*
* @see field_info_field_by_id()
......@@ -71,7 +71,7 @@ function field_info_field($entity_type, $field_name) {
* The ID of the field to retrieve. $field_id can refer to a deleted field.
*
* @return
* The \Drupal\field\FieldInterface field definition, as returned by
* The \Drupal\field\FieldConfigInterface field definition, as returned by
* entity_load_multiple_by_properties(), NULL if the field was not found.
*
* @see field_info_field()
......@@ -93,8 +93,8 @@ function field_info_field_by_id($field_id) {
* field_info_instances($entity_type, $bundle), it is recommended to use the
* getField() method on each $instance instead.
*
* @return \Drupal\field\FieldInterface[]
* An array of FieldInterface configuration entities, keyed by UUID.
* @return \Drupal\field\FieldConfigInterface[]
* An array of FieldConfigInterface configuration entities, keyed by UUID.
*
* @see field_info_field()
* @see field_info_field_by_id()
......
......@@ -8,7 +8,7 @@
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Entity\FieldableDatabaseStorageController;
use Drupal\Core\Entity\EntityStorageControllerInterface;
use Drupal\field\FieldInterface;
use Drupal\field\FieldConfigInterface;
/**
* Implements hook_views_data().
......@@ -59,13 +59,13 @@ function field_views_data_alter(&$data) {
/**
* Determines whether the entity type the field appears in is SQL based.
*
* @param \Drupal\field\FieldInterface $field
* @param \Drupal\field\FieldConfigInterface $field
* The field definition.
*
* @return bool
* True if the entity type uses DatabaseStorageController.
*/
function _field_views_is_sql_entity_type(FieldInterface $field) {
function _field_views_is_sql_entity_type(FieldConfigInterface $field) {
$entity_manager = \Drupal::entityManager();
if ($entity_manager->getDefinition($field->entity_type) && $entity_manager->getStorageController($field->entity_type) instanceof FieldableDatabaseStorageController) {
return TRUE;
......@@ -102,13 +102,13 @@ function field_views_field_label($entity_type, $field_name) {
/**
* Default views data implementation for a field.
*
* @param \Drupal\field\FieldInterface $field
* @param \Drupal\field\FieldConfigInterface $field
* The field definition.
*
* @return array
* The default views data for the field.
*/
function field_views_field_default_views_data(FieldInterface $field) {
function field_views_field_default_views_data(FieldConfigInterface $field) {
$data = array();
// Check the field type is available.
......
......@@ -13,7 +13,7 @@
use Drupal\Core\Entity\EntityStorageControllerInterface;
use Drupal\Core\TypedData\DataDefinition;
use Drupal\field\FieldException;
use Drupal\field\FieldInterface;
use Drupal\field\FieldConfigInterface;
/**
* Defines the Field entity.
......@@ -32,7 +32,7 @@
* }
* )
*/
class FieldConfig extends ConfigEntityBase implements FieldInterface {
class FieldConfig extends ConfigEntityBase implements FieldConfigInterface {
/**
* The maximum length of the field name, in characters.
......
......@@ -12,7 +12,7 @@
use Drupal\Core\Entity\EntityStorageControllerInterface;
use Drupal\field\FieldException;
use Drupal\Core\TypedData\DataDefinition;
use Drupal\field\FieldInstanceInterface;
use Drupal\field\FieldInstanceConfigInterface;
/**
* Defines the Field instance entity.
......@@ -31,7 +31,7 @@
* }
* )
*/
class FieldInstanceConfig extends ConfigEntityBase implements FieldInstanceInterface {
class FieldInstanceConfig extends ConfigEntityBase implements FieldInstanceConfigInterface {
/**
* The instance ID.
......
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\field\FieldInterface.
* Contains \Drupal\field\FieldConfigInterface.
*/
namespace Drupal\field;
......@@ -13,7 +13,7 @@
/**
* Provides an interface defining a field entity.
*/
interface FieldInterface extends ConfigEntityInterface, FieldDefinitionInterface {
interface FieldConfigInterface extends ConfigEntityInterface, FieldDefinitionInterface {
/**
* Returns the list of bundles where the field has instances.
......
......@@ -70,7 +70,7 @@ class FieldInfo {
/**
* List of $field structures keyed by ID. Includes deleted fields.
*
* @var \Drupal\field\FieldInterface[]
* @var \Drupal\field\FieldConfigInterface[]
*/
protected $fieldsById = array();
......@@ -215,7 +215,7 @@ public function getFieldMap() {
/**
* Returns all fields, including deleted ones.
*
* @return \Drupal\field\FieldInterface[]
* @return \Drupal\field\FieldConfigInterface[]
* An array of field entities, keyed by field ID.
*/
public function getFields() {