コード例 #1
0
ファイル: Pgsql.php プロジェクト: devco/trilogy
 /**
  * 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 ?';
 }
コード例 #2
0
ファイル: StatementIterator.php プロジェクト: devco/trilogy
 /**
  * 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;
 }
コード例 #3
0
ファイル: SqlAbstract.php プロジェクト: devco/trilogy
 /**
  * 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);
 }