Commit 4b432572 authored by catch's avatar catch

Issue #3065609 by Charlie ChX Negyesi: Document translations vs getEntity()

parent 06d2de11
......@@ -168,7 +168,10 @@ public function getIterator() {
* Returns the wrapped entity object.
*
* @return \Drupal\Core\Entity\EntityInterface
* The wrapped entity object.
* The wrapped entity object. If the entity is translatable and a specific
* translation is required, always request it by calling ::getTranslation()
* or ::getUntranslated() as the language of the returned object is not
* defined.
*/
public function getEntity() {
return $this->entity;
......
......@@ -31,7 +31,10 @@ interface FieldItemListInterface extends ListInterface, AccessibleInterface {
* Gets the entity that field belongs to.
*
* @return \Drupal\Core\Entity\FieldableEntityInterface
* The entity object.
* The entity object. If the entity is translatable and a specific
* translation is required, always request it by calling ::getTranslation()
* or ::getUntranslated() as the language of the returned object is not
* defined.
*/
public function getEntity();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment