public function insert(array $set)
    {
        if (empty($set)) {
            return null;
        }
        if ($this->accum !== null) {
            $this->accum[] = $set;
            if (count($this->accum) >= $this->sizeAccum) {
                $this->multiInsert($this->accum, true);
                $this->accum = array();
            }
            $this->lastIdAccum++;
            return $this->lastIdAccum;
        }
        if ($this->map) {
            $set = $this->map->set($set);
        }
        if ($this->fake) {
            return $this->fake->insert($set);
        }
        $pattern = 'INSERT INTO ?t (?cols) VALUES (?ln)';
        $data = array($this->name, array_keys($set), array_values($set));
        return $this->db->query($pattern, $data)->id();
    }
public function insert(array $set)
    {
        if (empty($set)) {
            return null;
        }
        if ($this->accum !== null) {
            $this->accum[] = $set;
            if (count($this->accum) >= $this->sizeAccum) {
                $this->multiInsert($this->accum, true);
                $this->accum = array();
            }
            $this->lastIdAccum++;
            return $this->lastIdAccum;
        }
        if ($this->map) {
            $set = $this->map->set($set);
        }
        if ($this->fake) {
            return $this->fake->insert($set);
        }
        $pattern = 'INSERT INTO ?t (?cols) VALUES (?ln)';
        $data = array($this->name, array_keys($set), array_values($set));
        return $this->db->query($pattern, $data)->id();
    }
public function insert ( array $ set ) { if ( empty ( $ set ) ) { return null ; } if ( $ this -> accum !== null ) { $ this -> accum [ ] = $ set ; if ( count ( $ this -> accum ) >= $ this -> sizeAccum ) { $ this -> multiInsert ( $ this -> accum , true ) ; $ this -> accum = array ( ) ; } $ this -> lastIdAccum ++ ; return $ this -> lastIdAccum ; } if ( $ this -> map ) { $ set = $ this -> map -> set ( $ set ) ; } if ( $ this -> fake ) { return $ this -> fake -> insert ( $ set ) ; } $ pattern = 'INSERT INTO ?t (?cols) VALUES (?ln)' ; $ data = array ( $ this -> name , array_keys ( $ set ) , array_values ( $ set ) ) ; return $ this -> db -> query ( $ pattern , $ data ) -> id ( ) ; }
Inserts a row to the table

@param array $set
the data for set (a field => a value)
@return int
ID of the row
Inserts a row to the table