Add backend code for fetching image recommendation data for a given page or set of pages:
- Add an ImageRecommendationProvider service, a static implementation for unit tests (like StaticLinkRecommendationProvider), a subpage-based implementation for testing / developer setups (like SubpageLinkRecommendationProvider) and a client for the image recommendation API (like ServiceLinkRecommendationProvider). (Unlike Add Link, there is no need for caching data in the DB.)
- Add a value object for holding the returned by the service (like LinkRecommendation + LinkRecommendationMetadata - the split into two separate classes is probably not worth repeating, and there won't be much metadata in any case).
- Update HomepageHooks::onBeforePageDisplay() to select the appropriate mechanism, based on the task type, to load the task data. One possible way:
- create a shared interface for LinkRecommendation and the image recommendation equivalent
- create a shared interface for LinkRecommendationProvider and ImageRecommendationProvider
- drop LinkRecommendationHelper::getLinkRecommendation(), move the pruning logic to the DB-based link recommendation provider (maybe as a decorator so it can be used with the subpage-based provider as well), have onBeforePageDisplay() call the provider's get() method directly
- add a TaskTypeHandler method for obtaining the provider service