/** * @param DatabaseProcessor $processor * @throws ErrorException */ public function __construct(DatabaseProcessor $processor) { $this->processor = $processor; $this->result = $this->processor->getResult($processor->getSQL()); $this->count = (int) $this->processor->getNumberOfRowsFromResult($this->result); $this->position = 0; }