| @@ 85-95 (lines=11) @@ | ||
| 82 | * |
|
| 83 | * @return \eZ\Publish\SPI\Persistence\Content\Language[]|iterable |
|
| 84 | */ |
|
| 85 | public function getListById(array $ids): iterable |
|
| 86 | { |
|
| 87 | $languages = []; |
|
| 88 | foreach ($ids as $id) { |
|
| 89 | if (isset($this->mapById[$id])) { |
|
| 90 | $languages[$id] = $this->mapById[$id]; |
|
| 91 | } |
|
| 92 | } |
|
| 93 | ||
| 94 | return $languages; |
|
| 95 | } |
|
| 96 | ||
| 97 | /** |
|
| 98 | * Returns the Language with $languageCode from the cache. |
|
| @@ 123-133 (lines=11) @@ | ||
| 120 | * |
|
| 121 | * @return \eZ\Publish\SPI\Persistence\Content\Language[]|iterable |
|
| 122 | */ |
|
| 123 | public function getListByLocale(array $languageCodes): iterable |
|
| 124 | { |
|
| 125 | $languages = []; |
|
| 126 | foreach ($languageCodes as $languageCode) { |
|
| 127 | if (isset($this->mapByLocale[$languageCode])) { |
|
| 128 | $languages[$languageCode] = $this->mapByLocale[$languageCode]; |
|
| 129 | } |
|
| 130 | } |
|
| 131 | ||
| 132 | return $languages; |
|
| 133 | } |
|
| 134 | ||
| 135 | /** |
|
| 136 | * Returns all languages in the cache with locale as key. |
|