Revision 96582e8e8c480b5c063465d6b6c6ee23f15aa6e7

Committed on 25/06/2018 6:24 am by André R <andre.romcke@gmail.com> [GitHub Diff]

EZP-28956: Expose lazy loaded Location->getContent() on API for better DX (#2328)

* Add SPI ContentHandler::loadContentList() for bulk loading content

Note on cache:
- By design here version is skipped, as use case for loading lots of content is in current version.
- So one downside for cache here is that it won't reuse cache from load() method, causing cache to be duplcated in current design.

Possible ways to remedy:
- Force having to provide versions also on loadContentList() making it less efficient for some use cases (Page builder scenarios for instance)
- Allow $version on load() to be false, or expose a loadContentInCurrentVersion() kind of method, either way adapt usage for this so cache will be shared.

* Add Location->getContent() using lazy properties

* [Integration] Add coverage for Location->getContent()

* Change SearchService->findContent() to bulk load content

Now that we have method to load several at once, take advantage in findContent().

* [ContentViewBuilder] Take advantage of Location->getContent() to avoid duplicate loading

* Refactor for LoadStruct usage in SPI

* fix review comments

* Add internal ContentInfo proxy for ContentProxy usage

* Make Trash item contain Content as well (as it extends Location)

* Fix review comments

* Don't use unset() on properties when they are no longer needed

* Fix phpdoc on Abstract(Cache)Handler