Commit c920f910 authored by Mark Harding's avatar Mark Harding

(fix): if no hydrated entities don't return entities

1 merge request!221(refactor): support hydrating the first batch of entities
Pipeline #70069263 failed with stages
in 13 minutes and 10 seconds
......@@ -241,18 +241,22 @@ class Manager
}
}
$entities = [];
$hydrateGuids = array_map(function (FeedSyncEntity $feedSyncEntity) {
return $feedSyncEntity->getGuid();
}, array_slice($feedSyncEntities, 0, 12)); // hydrate the first 12
$hydratedEntities = $this->entitiesBuilder->get(['guids' => $hydrateGuids]);
if ($hydrateGuids) {
$hydratedEntities = $this->entitiesBuilder->get(['guids' => $hydrateGuids]);
foreach ($hydratedEntities as $entity) {
$entities[] = (new FeedSyncEntity)
->setGuid($entity->getGuid())
->setOwnerGuid($entity->getOwnerGuid())
->setUrn($entity->getUrn())
->setEntity($entity);
foreach ($hydratedEntities as $entity) {
$entities[] = (new FeedSyncEntity)
->setGuid($entity->getGuid())
->setOwnerGuid($entity->getOwnerGuid())
->setUrn($entity->getUrn())
->setEntity($entity);
}
}
// TODO: Optimize this
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment