protected ContentEntityBase::getLanguages()
File
- core/lib/Drupal/Core/Entity/ContentEntityBase.php, line 238
Class
- ContentEntityBase
- Implements Entity Field API specific enhancements to the Entity class.
Namespace
Drupal\Core\Entity
Code
1 2 3 4 5 6 7 8 9 10 11 12 | protected function getLanguages() { if ( empty ( $this ->languages)) { $this ->languages = $this ->languageManager()->getLanguages(LanguageInterface::STATE_ALL); // If the entity references a language that is not or no longer available, // we return a mock language object to avoid disrupting the consuming // code. if (!isset( $this ->languages[ $this ->defaultLangcode])) { $this ->languages[ $this ->defaultLangcode] = new Language( array ( 'id' => $this ->defaultLangcode)); } } return $this ->languages; } |
Please login to continue.