diff --git a/core/lib/Drupal/Core/Field/FieldConfigBase.php b/core/lib/Drupal/Core/Field/FieldConfigBase.php index 80c4823..3ce087a 100644 --- a/core/lib/Drupal/Core/Field/FieldConfigBase.php +++ b/core/lib/Drupal/Core/Field/FieldConfigBase.php @@ -153,7 +153,7 @@ * The name of a callback function that returns default values. * * The function will be called with the following arguments: - * - \Drupal\Core\Entity\ContentEntityInterface $entity + * - \Drupal\Core\Entity\FieldableEntityInterface $entity * The entity being created. * - \Drupal\Core\Field\FieldDefinitionInterface $definition * The field definition. diff --git a/core/modules/comment/src/CommentLinkBuilder.php b/core/modules/comment/src/CommentLinkBuilder.php index b1864da..9726712 100644 --- a/core/modules/comment/src/CommentLinkBuilder.php +++ b/core/modules/comment/src/CommentLinkBuilder.php @@ -8,7 +8,7 @@ namespace Drupal\comment; use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface; -use Drupal\Core\Entity\ContentEntityInterface; +use Drupal\Core\Entity\FieldableEntityInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; @@ -66,7 +66,7 @@ public function __construct(AccountInterface $current_user, CommentManagerInterf /** * {@inheritdoc} */ - public function buildCommentedEntityLinks(ContentEntityInterface $entity, array &$context) { + public function buildCommentedEntityLinks(FieldableEntityInterface $entity, array &$context) { $entity_links = array(); $view_mode = $context['view_mode']; if ($view_mode == 'search_index' || $view_mode == 'search_result' || $view_mode == 'print') { diff --git a/core/modules/comment/src/CommentLinkBuilderInterface.php b/core/modules/comment/src/CommentLinkBuilderInterface.php index 995efcf..e885425 100644 --- a/core/modules/comment/src/CommentLinkBuilderInterface.php +++ b/core/modules/comment/src/CommentLinkBuilderInterface.php @@ -7,7 +7,7 @@ namespace Drupal\comment; -use Drupal\Core\Entity\ContentEntityInterface; +use Drupal\Core\Entity\FieldableEntityInterface; /** * Defines an interface for building comment links on a commented entity. @@ -27,6 +27,6 @@ * @return array * Array of entity links. */ - public function buildCommentedEntityLinks(ContentEntityInterface $entity, array &$context); + public function buildCommentedEntityLinks(FieldableEntityInterface $entity, array &$context); } diff --git a/core/modules/comment/src/CommentStorage.php b/core/modules/comment/src/CommentStorage.php index 9639d59..c220d84 100644 --- a/core/modules/comment/src/CommentStorage.php +++ b/core/modules/comment/src/CommentStorage.php @@ -10,10 +10,10 @@ use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Database\Connection; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\ContentEntityDatabaseStorage; +use Drupal\Core\Entity\FieldableEntityInterface; use Drupal\Core\Session\AccountInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -131,7 +131,7 @@ public function getDisplayOrdinal(CommentInterface $comment, $comment_mode, $div /** * {@inheritdoc} */ - public function getNewCommentPageNumber($total_comments, $new_comments, ContentEntityInterface $entity, $field_name = 'comment') { + public function getNewCommentPageNumber($total_comments, $new_comments, FieldableEntityInterface $entity, $field_name = 'comment') { $instance = $entity->getFieldDefinition($field_name); $comments_per_page = $instance->getSetting('per_page'); diff --git a/core/modules/comment/src/CommentStorageInterface.php b/core/modules/comment/src/CommentStorageInterface.php index 2ecf1a3..0a17355 100644 --- a/core/modules/comment/src/CommentStorageInterface.php +++ b/core/modules/comment/src/CommentStorageInterface.php @@ -7,9 +7,9 @@ namespace Drupal\comment; -use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageInterface; +use Drupal\Core\Entity\FieldableEntityInterface; /** * Defines an interface for comment entity storage classes. @@ -46,7 +46,7 @@ public function getMaxThreadPerThread(CommentInterface $comment); * The total number of comments that the entity has. * @param int $new_comments * The number of new comments that the entity has. - * @param \Drupal\Core\Entity\ContentEntityInterface $entity + * @param \Drupal\Core\Entity\FieldableEntityInterface $entity * The entity to which the comments belong. * @param string $field_name * The field name on the entity to which comments are attached. @@ -54,7 +54,7 @@ public function getMaxThreadPerThread(CommentInterface $comment); * @return array|null * The page number where first new comment appears. (First page returns 0.) */ - public function getNewCommentPageNumber($total_comments, $new_comments, ContentEntityInterface $entity, $field_name = 'comment'); + public function getNewCommentPageNumber($total_comments, $new_comments, FieldableEntityInterface $entity, $field_name = 'comment'); /** * Gets the display ordinal or page number for a comment. diff --git a/core/modules/field/tests/modules/field_test/field_test.field.inc b/core/modules/field/tests/modules/field_test/field_test.field.inc index 6ebda87..676569b 100644 --- a/core/modules/field/tests/modules/field_test/field_test.field.inc +++ b/core/modules/field/tests/modules/field_test/field_test.field.inc @@ -5,7 +5,7 @@ * Defines a field type and its formatters and widgets. */ -use Drupal\Core\Entity\ContentEntityInterface; +use Drupal\Core\Entity\FieldableEntityInterface; use Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldItemListInterface; @@ -31,7 +31,7 @@ function field_test_field_storage_config_update_forbid(FieldStorageConfigInterfa /** * Sample 'default value' callback. */ -function field_test_default_value(ContentEntityInterface $entity, FieldDefinitionInterface $definition) { +function field_test_default_value(FieldableEntityInterface $entity, FieldDefinitionInterface $definition) { return array(array('value' => 99)); } diff --git a/core/modules/system/tests/modules/entity_test/entity_test.module b/core/modules/system/tests/modules/entity_test/entity_test.module index c7db020..2d63e5d 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.module +++ b/core/modules/system/tests/modules/entity_test/entity_test.module @@ -6,7 +6,7 @@ */ use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\ContentEntityInterface; +use Drupal\Core\Entity\FieldableEntityInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldItemListInterface; @@ -422,7 +422,7 @@ function entity_test_entity_test_mul_translation_delete(EntityInterface $transla /** * Field default value callback. * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity + * @param \Drupal\Core\Entity\FieldableEntityInterface $entity * The entity being created. * @param \Drupal\Core\Field\FieldDefinitionInterface $definition * The field definition. @@ -433,7 +433,7 @@ function entity_test_entity_test_mul_translation_delete(EntityInterface $transla * * @see \Drupal\field\Entity\FieldInstanceConfig::$default_value */ -function entity_test_field_default_value(ContentEntityInterface $entity, FieldDefinitionInterface $definition) { +function entity_test_field_default_value(FieldableEntityInterface $entity, FieldDefinitionInterface $definition) { return array(array('value' => $definition->getName() . '_' . $entity->language()->id)); }