/** * All DBs handle limiting differently. * * @param int $limit The limit. * @param int $offset The offset. * * @return string */ public function compileLimit(Statement\StatementInterface $stmt) { if (!$stmt->getLimit()) { return; } return 'LIMIT ? OFFSET ?'; }
/** * Resets iteration. * * @return void */ public function rewind() { if (!$this->executed) { $this->result = $this->statement->execute(); $this->count = count($this->result); $this->executed = true; } $this->index = 0; }
/** * Compiles and returns multiple table definitions. * * @param Statement\StatementInterface $stmt The statement to compile. * * @return string */ public function compileSourceDefinitions(Statement\StatementInterface $stmt) { $compiled = []; foreach ($stmt->getSources() as $source) { $compiled[] = $this->compileSourceDefinition($source); } return implode(', ', $compiled); }