From b832a6e6b3387f67897fcd371ab1adc4acd7e6c1 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Thu, 20 Jul 2017 09:48:44 +0200 Subject: [PATCH] TASK: Allow sub indexer to exchange limit As long as it's not configurable, allow concrete implementations to exchange. Necessary for one customer at the moment. --- Classes/Domain/Index/AbstractIndexer.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Classes/Domain/Index/AbstractIndexer.php b/Classes/Domain/Index/AbstractIndexer.php index b780dc5..475532b 100644 --- a/Classes/Domain/Index/AbstractIndexer.php +++ b/Classes/Domain/Index/AbstractIndexer.php @@ -83,8 +83,7 @@ abstract class AbstractIndexer implements IndexerInterface protected function getRecordGenerator() { $offset = 0; - // TODO: Make configurable. - $limit = 50; + $limit = $this->getLimit(); while (($records = $this->getRecords($offset, $limit)) !== []) { yield $records; @@ -92,6 +91,17 @@ abstract class AbstractIndexer implements IndexerInterface } } + /** + * Returns the limit to use to fetch records. + * + * @return int + */ + protected function getLimit() + { + // TODO: Make configurable. + return 50; + } + /** * @param int $offset * @param int $limit