Commit 510c81a9 authored by alexpott's avatar alexpott

Issue #2051923 by Berdir, dixon_, plach: Rename...

Issue #2051923 by Berdir, dixon_, plach: Rename \Drupal\Core\Entity\Field\Field, related subclasses and interfaces to *FieldItemList.
parent 2025d6eb
......@@ -18,14 +18,14 @@
* API, while extending them with entity-specific additions. I.e., an entity
* implements the ComplexDataInterface among others, thus is complex data
* containing fields as its data properties. The contained fields have to
* implement the \Drupal\Core\Entity\Field\FieldInterface, which builds upon
* implement the \Drupal\Core\Entity\Field\FieldItemListInterface, which builds upon
* typed data interfaces as well.
*
* When implementing this interface which extends Traversable, make sure to list
* IteratorAggregate or Iterator before this interface in the implements clause.
*
* @see \Drupal\Core\TypedData\TypedDataManager
* @see \Drupal\Core\Field\FieldInterface
* @see \Drupal\Core\Field\FieldItemListInterface
*/
interface EntityInterface extends ComplexDataInterface, AccessibleInterface, TranslatableInterface {
......
......@@ -62,7 +62,7 @@ class EntityNG extends Entity {
protected $values = array();
/**
* The array of fields, each being an instance of FieldInterface.
* The array of fields, each being an instance of FieldItemListInterface.
*
* @var array
*/
......@@ -221,7 +221,7 @@ public function get($property_name) {
/**
* Gets a translated field.
*
* @return \Drupal\Core\Entity\Field\FieldInterface
* @return \Drupal\Core\Entity\Field\FieldItemListInterface
*/
protected function getTranslatedField($property_name, $langcode) {
if ($this->translations[$this->activeLangcode]['status'] == static::TRANSLATION_REMOVED) {
......
......@@ -13,7 +13,7 @@
* Defines an interface for entity field definitions.
*
* An entity field is a data object that holds the values of a particular field
* for a particular entity (see \Drupal\Core\Entity\Field\FieldInterface). For
* for a particular entity (see \Drupal\Core\Entity\Field\FieldItemListInterface). For
* example, $node_1->body and $node_2->body contain different data and therefore
* are different field objects.
*
......
......@@ -18,7 +18,7 @@
* When implementing this interface which extends Traversable, make sure to list
* IteratorAggregate or Iterator before this interface in the implements clause.
*
* @see \Drupal\Core\Entity\Field\FieldInterface
* @see \Drupal\Core\Entity\Field\FieldItemListInterface
* @see \Drupal\Core\Entity\Field\FieldItemBase
*/
interface FieldItemInterface extends ComplexDataInterface {
......
......@@ -7,7 +7,7 @@
namespace Drupal\Core\Entity\Field;
use Drupal\Core\Entity\Field\FieldInterface;
use Drupal\Core\Entity\Field\FieldItemListInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\TypedData\TypedDataInterface;
use Drupal\Core\TypedData\ItemList;
......@@ -24,10 +24,8 @@
*
* Supported settings (below the definition's 'settings' key) are:
* - default_value: (optional) If set, the default value to apply to the field.
*
* @see \Drupal\Core\Entity\Field\FieldInterface
*/
class Field extends ItemList implements FieldInterface {
class FieldItemList extends ItemList implements FieldItemListInterface {
/**
* Numerically indexed array of field items, implementing the
......@@ -148,49 +146,49 @@ public function setValue($values, $notify = TRUE) {
}
/**
* Implements \Drupal\Core\Entity\Field\FieldInterface::getPropertyDefinition().
* Implements \Drupal\Core\Entity\Field\FieldItemListInterface::getPropertyDefinition().
*/
public function getPropertyDefinition($name) {
return $this->offsetGet(0)->getPropertyDefinition($name);
}
/**
* Implements \Drupal\Core\Entity\Field\FieldInterface::getPropertyDefinitions().
* Implements \Drupal\Core\Entity\Field\FieldItemListInterface::getPropertyDefinitions().
*/
public function getPropertyDefinitions() {
return $this->offsetGet(0)->getPropertyDefinitions();
}
/**
* Implements \Drupal\Core\Entity\Field\FieldInterface::__get().
* Implements \Drupal\Core\Entity\Field\FieldItemListInterface::__get().
*/
public function __get($property_name) {
return $this->offsetGet(0)->__get($property_name);
}
/**
* Implements \Drupal\Core\Entity\Field\FieldInterface::get().
* Implements \Drupal\Core\Entity\Field\FieldItemListInterface::get().
*/
public function get($property_name) {
return $this->offsetGet(0)->get($property_name);
}
/**
* Implements \Drupal\Core\Entity\Field\FieldInterface::__set().
* Implements \Drupal\Core\Entity\Field\FieldItemListInterface::__set().
*/
public function __set($property_name, $value) {
$this->offsetGet(0)->__set($property_name, $value);
}
/**
* Implements \Drupal\Core\Entity\Field\FieldInterface::__isset().
* Implements \Drupal\Core\Entity\Field\FieldItemListInterface::__isset().
*/
public function __isset($property_name) {
return $this->offsetGet(0)->__isset($property_name);
}
/**
* Implements \Drupal\Core\Entity\Field\FieldInterface::__unset().
* Implements \Drupal\Core\Entity\Field\FieldItemListInterface::__unset().
*/
public function __unset($property_name) {
return $this->offsetGet(0)->__unset($property_name);
......
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\Core\Entity\Field\FieldInterface.
* Contains \Drupal\Core\Entity\Field\FieldItemListInterface.
*/
namespace Drupal\Core\Entity\Field;
......@@ -25,7 +25,7 @@
* When implementing this interface which extends Traversable, make sure to list
* IteratorAggregate or Iterator before this interface in the implements clause.
*/
interface FieldInterface extends ListInterface, AccessibleInterface {
interface FieldItemListInterface extends ListInterface, AccessibleInterface {
/**
* Gets the entity that field belongs to.
......
......@@ -25,7 +25,7 @@ class FieldTypePluginManager extends DefaultPluginManager {
protected $defaults = array(
'settings' => array(),
'instance_settings' => array(),
'list_class' => '\Drupal\field\Plugin\Type\FieldType\ConfigField',
'list_class' => '\Drupal\field\Plugin\Type\FieldType\ConfigFieldItemList',
);
/**
......
......@@ -18,7 +18,7 @@
* id = "boolean_field",
* label = @Translation("Boolean field item"),
* description = @Translation("An entity field containing a boolean value."),
* list_class = "\Drupal\Core\Entity\Field\Field"
* list_class = "\Drupal\Core\Entity\Field\FieldItemList"
* )
*/
class BooleanItem extends FieldItemBase {
......
......@@ -18,7 +18,7 @@
* id = "date_field",
* label = @Translation("Date field item"),
* description = @Translation("An entity field containing a date value."),
* list_class = "\Drupal\Core\Entity\Field\Field"
* list_class = "\Drupal\Core\Entity\Field\FieldItemList"
* )
*/
class DateItem extends FieldItemBase {
......
......@@ -19,7 +19,7 @@
* id = "email_field",
* label = @Translation("E-mail field item"),
* description = @Translation("An entity field containing an e-mail value."),
* list_class = "\Drupal\Core\Entity\Field\Field"
* list_class = "\Drupal\Core\Entity\Field\FieldItemList"
* )
*/
class EmailItem extends LegacyConfigFieldItem {
......
......@@ -25,7 +25,7 @@
* id = "entity_reference_field",
* label = @Translation("Entity reference field item"),
* description = @Translation("An entity field containing an entity reference."),
* list_class = "\Drupal\Core\Entity\Field\Field",
* list_class = "\Drupal\Core\Entity\Field\FieldItemList",
* constraints = {"ValidReference" = TRUE}
* )
*/
......
......@@ -19,7 +19,7 @@
* @DataType(
* id = "field_item",
* label = @Translation("Field item"),
* list_class = "\Drupal\Core\Entity\Field\Field",
* list_class = "\Drupal\Core\Entity\Field\FieldItemList",
* derivative = "Drupal\Core\Entity\Plugin\DataType\Deriver\FieldItemDeriver"
* )
*/
......
......@@ -18,7 +18,7 @@
* id = "integer_field",
* label = @Translation("Integer field item"),
* description = @Translation("An entity field containing an integer value."),
* list_class = "\Drupal\Core\Entity\Field\Field"
* list_class = "\Drupal\Core\Entity\Field\FieldItemList"
* )
*/
class IntegerItem extends FieldItemBase {
......
......@@ -19,7 +19,7 @@
* id = "language_field",
* label = @Translation("Language field item"),
* description = @Translation("An entity field referencing a language."),
* list_class = "\Drupal\Core\Entity\Field\Field",
* list_class = "\Drupal\Core\Entity\Field\FieldItemList",
* constraints = {
* "ComplexData" = {
* "value" = {"Length" = {"max" = 12}}
......
......@@ -18,7 +18,7 @@
* id = "string_field",
* label = @Translation("String field item"),
* description = @Translation("An entity field containing a string value."),
* list_class = "\Drupal\Core\Entity\Field\Field"
* list_class = "\Drupal\Core\Entity\Field\FieldItemList"
* )
*/
class StringItem extends FieldItemBase {
......
......@@ -18,7 +18,7 @@
* id = "uri_field",
* label = @Translation("URI field item"),
* description = @Translation("An entity field containing a URI."),
* list_class = "\Drupal\Core\Entity\Field\Field"
* list_class = "\Drupal\Core\Entity\Field\FieldItemList"
* )
*/
class UriItem extends FieldItemBase {
......
......@@ -19,7 +19,7 @@
* id = "uuid_field",
* label = @Translation("UUID field item"),
* description = @Translation("An entity field containing a UUID."),
* list_class = "\Drupal\Core\Entity\Field\Field",
* list_class = "\Drupal\Core\Entity\Field\FieldItemList",
* constraints = {
* "ComplexData" = {
* "value" = {"Length" = {"max" = 128}}
......
......@@ -176,7 +176,7 @@ public function getPropertyPath() {
/**
* Implements \Drupal\Core\TypedData\TypedDataInterface::getParent().
*
* @return \Drupal\Core\Entity\Field\FieldInterface
* @return \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public function getParent() {
return $this->parent;
......
......@@ -45,56 +45,56 @@ class Feed extends EntityNG implements FeedInterface {
*
* @todo rename to id.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $fid;
/**
* Title of the feed.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $title;
/**
* The feed language code.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $langcode;
/**
* URL to the feed.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $url;
/**
* How often to check for new feed items, in seconds.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $refresh;
/**
* Last time feed was checked for new items, as Unix timestamp.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $checked;
/**
* Time when this feed was queued for refresh, 0 if not queued.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $queued;
/**
* The parent website of the feed; comes from the <link> element in the feed.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $link ;
......@@ -102,35 +102,35 @@ class Feed extends EntityNG implements FeedInterface {
* The parent website's description;
* comes from the <description> element in the feed.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $description;
/**
* An image representing the feed.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $image;
/**
* Calculated hash of the feed data, used for validating cache.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $hash;
/**
* Entity tag HTTP response header, used for validating cache.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $etag;
/**
* When the feed was last modified, as a Unix timestamp.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $modified;
......
......@@ -39,7 +39,7 @@ class Item extends EntityNG implements ItemInterface {
*
* @todo rename to id.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $iid;
......@@ -48,56 +48,56 @@ class Item extends EntityNG implements ItemInterface {
*
* @todo rename to feed_id.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $fid;
/**
* Title of the feed item.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $title;
/**
* The feed language code.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $langcode;
/**
* Link to the feed item.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $link;
/**
* Author of the feed item.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $author;
/**
* Body of the feed item.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $description;
/**
* Posted date of the feed item, as a Unix timestamp.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $timestamp;
/**
* Unique identifier for the feed item.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $guid;
......
......@@ -58,14 +58,14 @@ class CustomBlock extends EntityNG implements CustomBlockInterface {
/**
* The block ID.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $id;
/**
* The block revision ID.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $revision_id;
......@@ -76,42 +76,42 @@ class CustomBlock extends EntityNG implements CustomBlockInterface {
* has been specified. Only default revisions are saved to the block_custom
* table.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $isDefaultRevision = TRUE;
/**
* The block UUID.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $uuid;
/**
* The custom block type (bundle).
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $type;
/**
* The block language code.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $langcode;
/**
* The block description.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $info;
/**
* The block revision log message.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $log;
......
......@@ -58,63 +58,63 @@ class Comment extends EntityNG implements CommentInterface {
/**
* The comment ID.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $cid;
/**
* The comment UUID.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $uuid;
/**
* The parent comment ID if this is a reply to another comment.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $pid;
/**
* The entity ID for the entity to which this comment is attached.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $entity_id;
/**
* The entity type of the entity to which this comment is attached.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $entity_type;
/**
* The field to which this comment is attached.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $field_id;
/**
* The comment language code.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $langcode;
/**
* The comment title.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $subject;
/**
* The comment author ID.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $uid;
......@@ -123,7 +123,7 @@ class Comment extends EntityNG implements CommentInterface {
*
* For anonymous authors, this is the value as typed in the comment form.
*
* @var \Drupal\Core\Entity\Field\FieldInterface
* @var \Drupal\Core\Entity\Field\FieldItemListInterface
*/
public $name;
......@@ -132,7 +132,7 @@ class Comment extends EntityNG implements CommentInterface {
*