/**
  * Fügt der Datenbank-Tabelle einen entsprechenden Datensatz hinzu
  *
  * @return int  Anzahl der betroffenen Zeilen
  */
 protected function insertIntoDb()
 {
     $properties = $this->getProperties();
     if ($this->autoincKeyName !== null) {
         unset($properties[$this->autoincKeyName]);
     }
     if ($this->connection->getDbType() === 'pgsql') {
         foreach ($properties as $key => $value) {
             if (preg_match('/checksum$/', $key)) {
                 $properties[$key] = Util::pgBinEscape($value);
             }
         }
     }
     return $this->db->insert($this->table, $properties);
 }
Exemplo n.º 2
0
 protected function dbBin($binary)
 {
     if ($this->connection->getDbType() === 'pgsql') {
         return Util::pgBinEscape($binary);
     } else {
         return $binary;
     }
 }