public function replace(array $set)
    {
        if (empty($set)) {
            return null;
        }
        if ($this->map) {
            $set = $this->map->set($set);
        }
        if ($this->fake) {
            return $this->fake->replace($set);
        }
        $pattern = 'REPLACE INTO ?t (?cols) VALUES (?ln)';
        $data = array($this->name, array_keys($set), array_values($set));
        return $this->db->query($pattern, $data)->id();
    }
public function replace(array $set)
    {
        if (empty($set)) {
            return null;
        }
        if ($this->map) {
            $set = $this->map->set($set);
        }
        if ($this->fake) {
            return $this->fake->replace($set);
        }
        $pattern = 'REPLACE INTO ?t (?cols) VALUES (?ln)';
        $data = array($this->name, array_keys($set), array_values($set));
        return $this->db->query($pattern, $data)->id();
    }
public function replace ( array $ set ) { if ( empty ( $ set ) ) { return null ; } if ( $ this -> map ) { $ set = $ this -> map -> set ( $ set ) ; } if ( $ this -> fake ) { return $ this -> fake -> replace ( $ set ) ; } $ pattern = 'REPLACE INTO ?t (?cols) VALUES (?ln)' ; $ data = array ( $ this -> name , array_keys ( $ set ) , array_values ( $ set ) ) ; return $ this -> db -> query ( $ pattern , $ data ) -> id ( ) ; }
Replaces or inserts a row

@param array $set
@return int
Replaces or inserts a row