Currently in order to retrieve the default language / language code we have to first retrieve the default entity translation object, but this is actually unnecessary as we have the information about the default translation on each entity translaton object under the property $defaultLangcode so it makes to provide direct access to it.
As of now to retrieve the default language and language code we have to do :
$entity->getUntranslated()->language();
$entity->getUntranslated()->language()->getId();
But this way we are going to initialize unnecessary a new entity translation object if there isn't an existing one in the entity translation object cache.
For performance reasons it makes sense to have a direct access to the default language without having to initialize the entity default translation.
Comment | File | Size | Author |
---|---|---|---|
#3 | 2839132-3.patch | 15.78 KB | hchonov |
Comments
Comment #2
hchonovComment #3
hchonov