Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-29851

As a developer I want to be able to load several Locations at once

    Details

      Description

      As Developer I want a bulk loading API for locations, so Repository can handle such cases faster, and cache and SQL calls can be done as multi get instead of per item.

      Design

      Like other multi load API's return iterable list of objects, in this case Locations.
      Iterable as we might want to introduce custom collection in the future to expose more info, hence avoid hardcoding usage of plain PHP array type.

      API

               /**
                * Return list of unique Locations, with location id as key.
                *
                * Missing items (NotFound) & those user does not have access to (Unauthorized), will be missing from the
                * list and not cause any exception. It's up to calling logic to determine if this should cause exception or not.
                *
                * @param array $locationIds
                * @param string[]|null $prioritizedLanguages Filter on and use as prioritized language code on translated properties of returned objects.
                * @param bool|null $useAlwaysAvailable Respect always available flag on content when filtering on $prioritizedLanguages.
                *
                * @return \eZ\Publish\API\Repository\Values\Content\Location[]|iterable
                */
               public function loadLocationList(array $locationIds, array $prioritizedLanguages = null, bool $useAlwaysAvailable = null): iterable;
      

        Issue Links

          Activity

          Show
          André Rømcke added a comment - PR: https://github.com/ezsystems/ezpublish-kernel/pull/2493
          Show
          Maciej Tyrała added a comment - merged: https://github.com/ezsystems/ezpublish-kernel/commit/3e0b856c8962e5b4acbe3a56902636f08c78f4ee

            People

            • Assignee:
              Unassigned
              Reporter:
              André Rømcke
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: