Skip to content

Commit

Permalink
Merge branch '7.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Longosz committed Sep 4, 2018
2 parents 4803c63 + b0e599e commit cc95c7b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
20 changes: 14 additions & 6 deletions Persistence/Content/Handler.php
Expand Up @@ -61,7 +61,7 @@ public function createDraftFromVersion($contentId, $srcVersion, $userId);
*
* @param int|string $id
* @param int|string $version
* @param string[] $translations
* @param string[]|null $translations
*
* @return \eZ\Publish\SPI\Persistence\Content Content value object
*/
Expand All @@ -73,14 +73,22 @@ public function load($id, $version, array $translations = null);
* Missing items (NotFound) will be missing from the array and not cause an exception, it's up
* to calling logic to determine if this should cause exception or not.
*
* NOTE: Even if LoadStruct technically allows to load several versions of same content, this method does not allow
* this by design as content is returned as Map with key being content id.
* If items are missing but for other reasons then not being found, for instance exceptions during loading field
* data. Then the exception will be logged as warning or error depending on severity.
* The most common case of possible exceptions during loading of Content data is migration,
* where either custom Field Type configuration or implementation might not be aligned with new
* version of the system.
*
* @param \eZ\Publish\SPI\Persistence\Content\LoadStruct[] $contentLoadStructs
* NOTE!!: If you want to take always available flag into account, append main language
* to the list of languages(unless caller is asking for all languages). In some edge cases you'll end up with a
* bit more data returned, but upside is that storage engine is able to handle far larger datasets.
*
* @return \eZ\Publish\SPI\Persistence\Content[<int>]
* @param int[] $contentIds
* @param string[]|null $translations
*
* @return \eZ\Publish\SPI\Persistence\Content[]
*/
public function loadContentList(array $contentLoadStructs): array;
public function loadContentList(array $contentIds, array $translations = null): iterable;

/**
* Returns the metadata object for a content identified by $contentId.
Expand Down
2 changes: 2 additions & 0 deletions Persistence/Content/LoadStruct.php
Expand Up @@ -15,6 +15,8 @@
*
* Design implies features such as always available and language logic needs to be done in API layer, so SPI gets
* a specifc query to deal with for the lookup that can be safely cached.
*
* @deprecated Not in use anymore as of v7.2.3 as it was causing slow storage engine performance on large amount of bulk loading.
*/
class LoadStruct extends ValueObject
{
Expand Down

0 comments on commit cc95c7b

Please sign in to comment.