X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FField%2FFieldItemListInterface.php;fp=web%2Fcore%2Flib%2FDrupal%2FCore%2FField%2FFieldItemListInterface.php;h=ca24bd4e0fa129a42461eb3e459796713d80c55e;hp=c350432e21a7b9cf98c6994ab6a1419d65ec671f;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/lib/Drupal/Core/Field/FieldItemListInterface.php b/web/core/lib/Drupal/Core/Field/FieldItemListInterface.php index c350432e2..ca24bd4e0 100644 --- a/web/core/lib/Drupal/Core/Field/FieldItemListInterface.php +++ b/web/core/lib/Drupal/Core/Field/FieldItemListInterface.php @@ -30,7 +30,7 @@ interface FieldItemListInterface extends ListInterface, AccessibleInterface { /** * Gets the entity that field belongs to. * - * @return \Drupal\Core\Entity\EntityInterface + * @return \Drupal\Core\Entity\FieldableEntityInterface * The entity object. */ public function getEntity(); @@ -263,6 +263,9 @@ interface FieldItemListInterface extends ListInterface, AccessibleInterface { /** * Determines equality to another object implementing FieldItemListInterface. * + * This method is usually used by the storage to check for not computed + * value changes, which will be saved into the storage. + * * @param \Drupal\Core\Field\FieldItemListInterface $list_to_compare * The field item list to compare to. * @@ -271,4 +274,24 @@ interface FieldItemListInterface extends ListInterface, AccessibleInterface { */ public function equals(FieldItemListInterface $list_to_compare); + /** + * Determines whether the field has relevant changes. + * + * This is for example used to determine if a revision of an entity has + * changes in a given translation. Unlike + * \Drupal\Core\Field\FieldItemListInterface::equals(), this can report + * that for example an untranslatable field, despite being changed and + * therefore technically affecting all translations, is only internal metadata + * or only affects a single translation. + * + * @param \Drupal\Core\Field\FieldItemListInterface $original_items + * The original field items to compare against. + * @param string $langcode + * The language that should be checked. + * + * @return bool + * TRUE if the field has relevant changes, FALSE if not. + */ + public function hasAffectingChanges(FieldItemListInterface $original_items, $langcode); + }