Skip to content

Commit

Permalink
EZP-30006: As a Developer I possibility to load several languages at …
Browse files Browse the repository at this point in the history
…once (#2524)

Introduces API to load several languages at once (specifically by id or locale), exposes more specific methods on languageMask handler and in SPI to make language handling more efficient.
  • Loading branch information
andrerom committed Feb 19, 2019
1 parent 32c84b7 commit fc960a6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Persistence/Content/Language/Handler.php
Expand Up @@ -42,6 +42,18 @@ public function update(Language $struct);
*/
public function load($id);

/**
* Get list of languages by id.
*
* Missing items (NotFound) will be missing from the returned iterable and not cause an exception, it's up
* to calling logic to determine if this should cause exception or not.
*
* @param array $ids
*
* @return \eZ\Publish\SPI\Persistence\Content\Language[]|iterable
*/
public function loadList(array $ids): iterable;

/**
* Get language by Language Code (eg: eng-GB).
*
Expand All @@ -53,6 +65,18 @@ public function load($id);
*/
public function loadByLanguageCode($languageCode);

/**
* Get list of languages by Language Code (eg: eng-GB).
*
* Missing items (NotFound) will be missing from the returned iterable and not cause an exception, it's up
* to calling logic to determine if this should cause exception or not.
*
* @param string[] $languageCodes
*
* @return \eZ\Publish\SPI\Persistence\Content\Language[]|iterable
*/
public function loadListByLanguageCodes(array $languageCodes): iterable;

/**
* Get all languages.
*
Expand Down

0 comments on commit fc960a6

Please sign in to comment.