category::add (public)

 category::add [ -category_id category_id ] -tree_id tree_id \
    -parent_id parent_id -name name [ -locale locale ] \
    [ -description description ] [ -deprecated_p deprecated_p ] \
    [ -user_id user_id ] [ -creation_ip creation_ip ] [ -noflush ]

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

Insert a new category. The same translation will be added in the default language if it's in a different language.

Switches:
-category_id (optional)
-tree_id (required)
-parent_id (required)
-name (required)
-locale (optional)
-description (optional)
-deprecated_p (optional, defaults to "f")
-user_id (optional)
-creation_ip (optional)
-noflush (optional, boolean)
Options:
-category_id
category_id of the category to be inserted.
-locale
locale of the language. [ad_conn locale] used by default.
-name
category name.
-description
description of the category.
-deprecated_p
is category deprecated?
-tree_id
tree_id of the category the category should be added.
-parent_id
id of the parent category. "" if top level category.
-user_id
user that adds the category. [ad_conn user_id] used by default.
-creation_ip
ip-address of the user that adds the category. [ad_conn peeraddr] used by default.
-noflush
defer calling category_tree::flush_cache (which if adding multiple categories to a large tree can be very expensive). note that if you set this flag you must call category_tree::flush_cache once the adds are complete.
Returns:
category_id
Author:
Timo Hentschel <timo@timohentschel.de>

Testcases:
category_synonyms, category_link, category_crud, category_get_procs, category_tree_procs
[ show source ]
Show another procedure: