category::get (public)

 category::get -category_id category_id [ -locale locale ]

Defined in packages/categories/tcl/categories-procs.tcl

Get name and description for a category_id in the given or connection's locale. If for the combination of category and locale no entry in category_translations exists, then empty is returned.

Switches:
-category_id
(required)
-locale
(optional)
Options:
-category_id
category_id of the category to be queried.
-locale
locale of the language. [ad_conn locale] used by default.
Returns:
list of attribute value pairs containing name and description

Partial Call Graph (max 5 caller/called nodes):
%3 test_category_crud category_crud (test categories) category::get category::get test_category_crud->category::get test_category_get_procs category_get_procs (test categories) test_category_get_procs->category::get ad_conn ad_conn (public) category::get->ad_conn db_0or1row db_0or1row (public) category::get->db_0or1row packages/categories/www/cadmin/category-form.tcl packages/categories/ www/cadmin/category-form.tcl packages/categories/www/cadmin/category-form.tcl->category::get

Testcases:
category_crud, category_get_procs
Source code:
    if {$locale eq ""} {
        set locale [ad_conn locale]
    }

    if {[db_0or1row category_get {
        select name, description
        from category_translations
        where category_id = :category_id
        and locale = :locale
    }]} {
        set result [list name $name description $description]
    } else {
        set result ""
    }
    return $result
XQL Not present:
Generic
PostgreSQL XQL file:
packages/categories/tcl/categories-procs-postgresql.xql

Oracle XQL file:
packages/categories/tcl/categories-procs-oracle.xql

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