roundcubemail/program/lib/Roundcube/rcube_user.php
function update_identity($iid, $data)
    {
        if (!$this->ID)
            return false;

        $query_cols = $query_params = array();

        foreach ((array)$data as $col => $value) {
            $query_cols[]   = $this->db->quote_identifier($col) . ' = ?';
            $query_params[] = $value;
        }
        $query_params[] = $iid;
        $query_params[] = $this->ID;

        $sql = "UPDATE ".$this->db->table_name('identities', true).
            " SET `changed` = ".$this->db->now().", ".join(', ', $query_cols).
            " WHERE `identity_id` = ?".
                " AND `user_id` = ?".
                " AND `del` <> 1";

        call_user_func_array(array($this->db, 'query'),
            array_merge(array($sql), $query_params));

        // clear the cache
        $this->identities = array();
        $this->emails     = null;

        return $this->db->affected_rows();
    }
function update_identity($iid, $data)
    {
        if (!$this->ID)
            return false;

        $query_cols = $query_params = array();

        foreach ((array)$data as $col => $value) {
            $query_cols[]   = $this->db->quote_identifier($col) . ' = ?';
            $query_params[] = $value;
        }
        $query_params[] = $iid;
        $query_params[] = $this->ID;

        $sql = "UPDATE ".$this->db->table_name('identities', true).
            " SET `changed` = ".$this->db->now().", ".join(', ', $query_cols).
            " WHERE `identity_id` = ?".
                " AND `user_id` = ?".
                " AND `del` <> 1";

        call_user_func_array(array($this->db, 'query'),
            array_merge(array($sql), $query_params));

        // clear the cache
        $this->identities = array();
        $this->emails     = null;

        return $this->db->affected_rows();
    }
function update_identity ( $ iid , $ data ) { if ( ! $ this -> ID ) return false ; $ query_cols = $ query_params = array ( ) ; foreach ( ( array ) $ data as $ col => $ value ) { $ query_cols [ ] = $ this -> db -> quote_identifier ( $ col ) . ' = ?' ; $ query_params [ ] = $ value ; } $ query_params [ ] = $ iid ; $ query_params [ ] = $ this -> ID ; $ sql = "UPDATE " . $ this -> db -> table_name ( 'identities' , true ) . " SET `changed` = " . $ this -> db -> now ( ) . ", " . join ( ', ' , $ query_cols ) . " WHERE `identity_id` = ?" . " AND `user_id` = ?" . " AND `del` <> 1" ; call_user_func_array ( array ( $ this -> db , 'query' ) , array_merge ( array ( $ sql ) , $ query_params ) ) ; // clear the cache $ this -> identities = array ( ) ; $ this -> emails = null ; return $ this -> db -> affected_rows ( ) ; }
Update a specific identity record

@param int    $iid  Identity ID
@param array  $data Hash array with col->value pairs to save
@return boolean True if saved successfully, false if nothing changed
Update a specific identity record