person::update (public)

 person::update -person_id person_id [ -first_names first_names ] \
    [ -last_name last_name ] [ -bio bio ]

Defined in packages/acs-tcl/tcl/community-core-procs.tcl

Update person information.

Switches:
-person_id
(required)
-first_names
(optional)
-last_name
(optional)
-bio
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_person_procs_test person_procs_test (test acs-tcl) person::update person::update test_person_procs_test->person::update db_dml db_dml (public) person::update->db_dml person::flush_cache person::flush_cache (public) person::update->person::flush_cache person::flush_person_info person::flush_person_info (public) person::update->person::flush_person_info auth::create_local_account auth::create_local_account (public) auth::create_local_account->person::update auth::update_local_account auth::update_local_account (public) auth::update_local_account->person::update person::update_bio person::update_bio (public, deprecated) person::update_bio->person::update

Testcases:
person_procs_test
Source code:
    set cols [list]
    foreach var {first_names last_name bio} {
        if { [info exists $var] } {
            lappend cols "$var = :$var"
        }
    }
    if {[llength $cols] == 0} {
        return
    }

    db_dml update_person {}

    # update object title if changed
    if {[info exists first_names] ||
        [info exists last_name]} {
        db_dml update_object_title {}
        # need to flush also objects attributes for the party
        person::flush_cache -person_id $person_id
    } else {
        # only need to flush person information (e.g. bio)
        person::flush_person_info -person_id $person_id
    }
Generic XQL file:
<fullquery name="person::update.update_person">
    <querytext>

	update persons
         set    [join $cols ", "]
         where person_id = :person_id

      </querytext>
</fullquery>

<fullquery name="person::update.update_object_title">
    <querytext>

	update acs_objects
	set title = :first_names || ' ' || :last_name
	where object_id = :person_id

      </querytext>
</fullquery>
packages/acs-tcl/tcl/community-core-procs.xql

PostgreSQL XQL file:
packages/acs-tcl/tcl/community-core-procs-postgresql.xql

Oracle XQL file:
packages/acs-tcl/tcl/community-core-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: