Details
-
Story
-
Resolution: Fixed
-
High
-
None
-
None
Description
As a developer, if I specify which language to load from the API, when working with the returned API objects I expect these value objects to also take the language argument into account.
Example
Instead of this:
$content = $this->contentService->loadContent( 42, $this->configResolver->getParameter('languages') ); $name = $content->getVersionInfo()->getName( $this->configResolver->getParameter('languages')[0] ); // OR rather to take care of all languages: $this->translationHelper->getTranslatedContentName($content); $field = $this->translationHelper->getTranslatedField($content, 'body'); $value = $field->value;
I would prefer this:
$content = $this->contentService->loadContent( 42, $this->configResolver->getParameter('languages') ); $name = $content->getVersionInfo()->getName(); $value = $content->getFieldValue('body')