Procedural File: category_api.php
Source Location: /core/category_api.php
Page Details:
Tags:
category_add [line 111]
int category_add(
int $p_project_id, string $p_name)
|
|
Add a new category to the project
Tags:
Parameters
int |
$p_project_id |
Project id |
string |
$p_name |
Category Name |
category_cache_array_rows [line 459]
null category_cache_array_rows(
array $p_cat_id_array)
|
|
Tags:
Parameters
array |
$p_cat_id_array |
array of category id's |
category_cache_array_rows_by_project [line 339]
void category_cache_array_rows_by_project(
$p_project_id_array)
|
|
Parameters
category_ensure_exists [line 61]
void category_ensure_exists(
int $p_category_id)
|
|
Check whether the category exists in the project Trigger an error if it does not
Tags:
Parameters
int |
$p_category_id |
category id |
category_ensure_unique [line 98]
null category_ensure_unique(
int $p_project_id, string $p_name)
|
|
Check whether the category is unique within a project Trigger an error if it is not
Tags:
Parameters
int |
$p_project_id |
Project id |
string |
$p_name |
Category Name |
category_exists [line 34]
bool category_exists(
int $p_category_id)
|
|
Check whether the category exists in the project
Tags:
Parameters
int |
$p_category_id |
category id |
category_full_name [line 550]
string category_full_name(
string $p_category_id, [bool $p_show_project = true], [ $p_current_project = null], int $p_project_id)
|
|
Retrieves category name (including project name if required)
Tags:
Parameters
string |
$p_category_id |
category id |
bool |
$p_show_project |
show project details |
int |
$p_project_id |
current project id override |
|
$p_current_project |
|
category_get_all_rows [line 387]
array category_get_all_rows(
int $p_project_id, [bool $p_inherit = null], [bool $p_sort_by_project = false])
|
|
Return all categories for the specified project id. Obeys project hierarchies and such.
Tags:
Parameters
int |
$p_project_id |
Project id |
bool |
$p_inherit |
indicates whether to inherit categories from parent projects, or null to use configuration default. |
bool |
$p_sort_by_project |
|
category_get_field [line 496]
string category_get_field(
int $p_category_id, $p_field_name, string $p_name)
|
|
Given a category id and a field name, this function returns the field value. An error will be triggered for a non-existent category id or category id = 0.
Tags:
Parameters
int |
$p_category_id |
category id |
string |
$p_name |
field name |
|
$p_field_name |
|
category_get_id_by_name [line 522]
bool category_get_id_by_name(
string $p_category_name, int $p_project_id, [bool $p_trigger_errors = true])
|
|
Given a category name and project, this function returns the category id. An error will be triggered if the specified project does not have a category with that name.
Tags:
Parameters
string |
$p_category_name |
category name |
int |
$p_project_id |
project id |
bool |
$p_trigger_errors |
trigger error on failure |
category_get_name [line 508]
string category_get_name(
int $p_category_id)
|
|
Given a category id, this function returns the category name. An error will be triggered for a non-existent category id or category id = 0.
Tags:
Parameters
int |
$p_category_id |
category id |
category_get_row [line 279]
array category_get_row(
int $p_category_id)
|
|
Return the definition row for the category
Tags:
Parameters
int |
$p_category_id |
Category id |
category_is_unique [line 74]
bool category_is_unique(
int $p_project_id, string $p_name)
|
|
Check whether the category is unique within a project
Tags:
Parameters
int |
$p_project_id |
project id |
string |
$p_name |
project name |
category_remove [line 182]
bool category_remove(
int $p_category_id, [int $p_new_category_id = 0])
|
|
Remove a category from the project
Tags:
Parameters
int |
$p_category_id |
Category id |
int |
$p_new_category_id |
new category id (to replace existing category) |
category_remove_all [line 225]
bool category_remove_all(
int $p_project_id, [int $p_new_category_id = 0])
|
|
Remove all categories associated with a project
Tags:
Parameters
int |
$p_project_id |
Project ID |
int |
$p_new_category_id |
new category id (to replace existing category) |
category_sort_rows_by_project [line 311]
int category_sort_rows_by_project(
array $p_category1, [array $p_category2 = null])
|
|
Sort categories based on what project they're in. Call beforehand with a single parameter to set a 'preferred' project.
Tags:
Parameters
array |
$p_category1 |
array containing category details |
array |
$p_category2 |
array containing category details |
category_update [line 141]
bool category_update(
int $p_category_id, string $p_name, int $p_assigned_to)
|
|
Update the name and user associated with the category
Tags:
Parameters
int |
$p_category_id |
Category id |
string |
$p_name |
Category Name |
int |
$p_assigned_to |
User ID that category is assigned to |
|