resourceConnection = $resourceConnection; $this->selectBuilder = $selectBuilder; } /** * @param int $stockId * @return ArrayIterator */ public function execute(int $stockId): ArrayIterator { $select = $this->selectBuilder->execute($stockId); $connection = $this->resourceConnection->getConnection(); return new ArrayIterator($connection->fetchAll($select)); } }