CoreAPI
[ class tree: CoreAPI ] [ index: CoreAPI ] [ all elements ]

Procedural File: category_api.php

Source Location: /core/category_api.php



Page Details:



Tags:

copyright:  Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
copyright:  Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
link:  http://www.mantisbt.org








category_add [line 111]

int category_add( int $p_project_id, string $p_name)

Add a new category to the project



Tags:

return:  Category ID
access:  public


Parameters

int   $p_project_id   Project id
string   $p_name   Category Name
[ Top ]



category_cache_array_rows [line 459]

null category_cache_array_rows( array $p_cat_id_array)



Tags:

access:  public


Parameters

array   $p_cat_id_array   array of category id's
[ Top ]



category_cache_array_rows_by_project [line 339]

void category_cache_array_rows_by_project( $p_project_id_array)



Parameters

   $p_project_id_array  
[ Top ]



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:

access:  public


Parameters

int   $p_category_id   category id
[ Top ]



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:

access:  public


Parameters

int   $p_project_id   Project id
string   $p_name   Category Name
[ Top ]



category_exists [line 34]

bool category_exists( int $p_category_id)

Check whether the category exists in the project



Tags:

return:  Return true if the category exists, false otherwise
access:  public


Parameters

int   $p_category_id   category id
[ Top ]



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:

return:  category full name
access:  public


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  
[ Top ]



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:

return:  array of categories
access:  public


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  
[ Top ]



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:

return:  field value
access:  public


Parameters

int   $p_category_id   category id
string   $p_name   field name
   $p_field_name  
[ Top ]



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:

access:  public


Parameters

string   $p_category_name   category name
int   $p_project_id   project id
bool   $p_trigger_errors   trigger error on failure
[ Top ]



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:

return:  category name
access:  public


Parameters

int   $p_category_id   category id
[ Top ]



category_get_row [line 279]

array category_get_row( int $p_category_id)

Return the definition row for the category



Tags:

return:  array containing category details
access:  public


Parameters

int   $p_category_id   Category id
[ Top ]



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:

return:  Returns true if the category is unique, false otherwise
access:  public


Parameters

int   $p_project_id   project id
string   $p_name   project name
[ Top ]



category_remove [line 182]

bool category_remove( int $p_category_id, [int $p_new_category_id = 0])

Remove a category from the project



Tags:

access:  public


Parameters

int   $p_category_id   Category id
int   $p_new_category_id   new category id (to replace existing category)
[ Top ]



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:

access:  public


Parameters

int   $p_project_id   Project ID
int   $p_new_category_id   new category id (to replace existing category)
[ Top ]



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:

return:  integer representing sort order
access:  public


Parameters

array   $p_category1   array containing category details
array   $p_category2   array containing category details
[ Top ]



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:

access:  public


Parameters

int   $p_category_id   Category id
string   $p_name   Category Name
int   $p_assigned_to   User ID that category is assigned to
[ Top ]



Documentation generated on Sun, 12 Dec 2010 23:50:13 +0900 by phpDocumentor 1.4.3
inserted by FC2 system