diff --git a/core/lib/Drupal/Core/Entity/Plugin/DataType/FloatItem.php b/core/lib/Drupal/Core/Entity/Plugin/field/field_type/FloatItem.php similarity index 67% rename from core/lib/Drupal/Core/Entity/Plugin/DataType/FloatItem.php rename to core/lib/Drupal/Core/Entity/Plugin/field/field_type/FloatItem.php index 5cd50f9..6e35ac4 100644 --- a/core/lib/Drupal/Core/Entity/Plugin/DataType/FloatItem.php +++ b/core/lib/Drupal/Core/Entity/Plugin/field/field_type/FloatItem.php @@ -2,23 +2,21 @@ /** * @file - * Contains \Drupal\Core\Entity\Plugin\DataType\FloatItem. + * Contains \Drupal\Core\Entity\Plugin\field\field_type\FloatItem. */ -namespace Drupal\Core\Entity\Plugin\DataType; +namespace Drupal\Core\Entity\Plugin\field\field_type; -use Drupal\Core\TypedData\Annotation\DataType; -use Drupal\Core\Annotation\Translation; use Drupal\Core\Entity\Field\FieldItemBase; /** - * Defines the 'float_field' entity field item. + * Defines the 'float' entity field type. * * @DataType( - * id = "float_field", - * label = @Translation("Float field item"), + * id = "float", + * label = @Translation("Float"), * description = @Translation("An entity field containing an float value."), - * list_class = "\Drupal\Core\Entity\Field\Field" + * configurable = false, * ) */ class FloatItem extends FieldItemBase { diff --git a/core/modules/comment/lib/Drupal/comment/CommentFieldName.php b/core/modules/comment/lib/Drupal/comment/CommentFieldName.php index 24bbff7..9f6daa8 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentFieldName.php +++ b/core/modules/comment/lib/Drupal/comment/CommentFieldName.php @@ -7,7 +7,7 @@ namespace Drupal\comment; -use Drupal\Core\Entity\Plugin\DataType\StringItem; +use Drupal\Core\Entity\Plugin\field\field_type\StringItem; /** * The field item for the 'fieldname' field. diff --git a/core/modules/system/lib/Drupal/system/Tests/TypedData/TypedDataTest.php b/core/modules/system/lib/Drupal/system/Tests/TypedData/TypedDataTest.php index d0d61fa..1f4b8f0 100644 --- a/core/modules/system/lib/Drupal/system/Tests/TypedData/TypedDataTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/TypedData/TypedDataTest.php @@ -548,7 +548,7 @@ public function testTypedDataValidation() { // Test validating property containers and make sure the NotNull and Null // constraints work with typed data containers. $definition = array( - 'type' => 'integer_field', + 'type' => 'field_item:integer', 'constraints' => array( 'NotNull' => array(), ), @@ -569,7 +569,7 @@ public function testTypedDataValidation() { // Test the Null constraint with typed data containers. $definition = array( - 'type' => 'float_field', + 'type' => 'field_item:float', 'constraints' => array( 'Null' => array(), ), @@ -605,7 +605,7 @@ public function testTypedDataValidation() { // Test validating a list of a values and make sure property paths starting // with "0" are created. $definition = array( - 'type' => 'integer_field', + 'type' => 'field_item:integer', 'list' => TRUE, ); $violations = $this->typedData->create($definition, array(array('value' => 10)))->validate();