/**
  * initializeStatement
  *
  * Initialiseer de statement en berekent de index waarop parameters zoals max en start gebonden moeten worden.
  * @since   23 okt 2007
  * @param   boolean     $clear  Afdwingen dat de statement opnieuw wordt aangemaakt.
  * @return  void
  */
 private function initializeStatement($clear = false)
 {
     if (isset($this->stmt) && $this->stmt instanceof PDOStatement && !$clear) {
         return;
     }
     $sql = $this->sql . " LIMIT ? OFFSET ?";
     $this->logger->log($sql);
     $this->stmt = $this->conn->prepare($sql);
     $nextIndex = 1;
     if ($this->mode == self::MODE_PARAMETERIZED) {
         for ($i = 0; $i < count($this->values); $i++) {
             if (is_bool($this->values[$i])) {
                 $this->stmt->bindValue($i + 1, $this->values[$i], PDO::PARAM_BOOL);
             } else {
                 $this->stmt->bindValue($i + 1, $this->values[$i]);
             }
         }
         $nextIndex = ++$i;
     }
     $this->index['max'] = $nextIndex++;
     $this->index['start'] = $nextIndex++;
 }
Beispiel #2
0
 public function testLogtNiet()
 {
     $logger = new KVDdom_SqlLogger();
     $this->assertEquals(false, $logger->log('SELECT * FROM TEST;'));
 }