public function iterate(?array
$offset): ?EntityIndexingMessage
{ $iterator =
$this->iteratorFactory->
createIterator($this->folderRepository->
getDefinition(),
$offset);
$ids =
$iterator->
fetch();
if (empty($ids)) { return null;
} return new MediaIndexingMessage(array_values($ids),
$iterator->
getOffset());
} public function update(EntityWrittenContainerEvent
$event): ?EntityIndexingMessage
{ $updates =
$event->
getPrimaryKeys(MediaFolderDefinition::ENTITY_NAME
);
$mediaFolderEvent =
$event->
getEventByEntityName(MediaFolderDefinition::ENTITY_NAME
);
if (empty($updates) || !
$mediaFolderEvent) { return null;
}