function insert_identity($data)
    {
        if (!$this->ID)
            return false;

        unset($data['user_id']);

        $insert_cols   = array();
        $insert_values = array();

        foreach ((array)$data as $col => $value) {
            $insert_cols[]   = $this->db->quote_identifier($col);
            $insert_values[] = $value;
        }

        $insert_cols[]   = $this->db->quote_identifier('user_id');
        $insert_values[] = $this->ID;

        $sql = "INSERT INTO ".$this->db->table_name('identities', true).
            " (`changed`, ".join(', ', $insert_cols).")".
            " VALUES (".$this->db->now().", ".join(', ', array_pad(array(), count($insert_values), '?')).")";

        $insert = $this->db->query($sql, $insert_values);

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

        return $this->db->insert_id('identities');
    }