category::update (public)
category::update -category_id category_id -name name \ [ -locale locale ] [ -description description ] \ [ -user_id user_id ] [ -modifying_ip modifying_ip ]
Defined in packages/categories/tcl/categories-procs.tcl
Updates/inserts a category translation.
- Switches:
- Options:
- -category_id (required)
- -name (required)
- -locale (optional)
- -description (optional)
- -user_id (optional)
- -modifying_ip (optional)
- -category_id
- category_id of the category to be updated.
- -locale
- locale of the language. [ad_conn locale] used by default.
- -name
- category name.
- -description
- description of the category.
- -user_id
- user that updates the category. [ad_conn user_id] used by default.
- -modifying_ip
- ip-address of the user that updates the category. [ad_conn peeraddr] used by default.
- Author:
- Timo Hentschel <timo@timohentschel.de>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- category_crud
Source code: if {$user_id eq ""} { set user_id [ad_conn user_id] } if {$modifying_ip eq ""} { set modifying_ip [ad_conn peeraddr] } if {$locale eq ""} { set locale [ad_conn locale] } db_transaction { if {![db_0or1row check_category_existence { select 1 from category_translations where category_id = :category_id and locale = :locale }]} { db_exec_plsql insert_category_translation "" } else { db_exec_plsql update_category_translation "" } flush_translation_cache $category_id }XQL Not present: Generic PostgreSQL XQL file: <fullquery name="category::update.insert_category_translation"> <querytext> select category__new_translation ( :category_id, :locale, :name, :description, current_timestamp, :user_id, :modifying_ip ) </querytext> </fullquery> <fullquery name="category::update.update_category_translation"> <querytext> select category__edit ( :category_id, :locale, :name, :description, current_timestamp, :user_id, :modifying_ip ) </querytext> </fullquery>packages/categories/tcl/categories-procs-postgresql.xql
Oracle XQL file: <fullquery name="category::update.insert_category_translation"> <querytext> begin category.new_translation ( category_id => :category_id, locale => :locale, name => :name, description => :description, modifying_user => :user_id, modifying_ip => :modifying_ip ); end; </querytext> </fullquery> <fullquery name="category::update.update_category_translation"> <querytext> begin category.edit ( category_id => :category_id, locale => :locale, name => :name, description => :description, modifying_user => :user_id, modifying_ip => :modifying_ip ); end; </querytext> </fullquery>packages/categories/tcl/categories-procs-oracle.xql