Details
-
Type:
Story
-
Status: Closed
-
Priority:
High
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.10.0
-
Component/s: Platform > API interfaces
-
Labels:None
-
Epic Link:
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')