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

Procedural File: category_api.php

Source Location: /core/category_api.php

Page Details
Copyright:  Copyright (C) 2002 - 2009 MantisBT Team - mantisbt-dev@lists.sourceforge.net
Copyright:  Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
Link:  http://www.mantisbt.org
Functions
category_add  [line 111]

int category_add( int $p_project_id, string $p_name  )

Add a new category to the project

Parameters:
int   $p_project_id:  Project id
string   $p_name:  Category Name

API Tags:
Return:  Category ID
Access:  public


[ Top ]
category_cache_array_rows  [line 452]

null category_cache_array_rows( array $p_cat_id_array  )
Parameters:
array   $p_cat_id_array:  array of category id's

API Tags:
Access:  public


[ Top ]
category_cache_array_rows_by_project  [line 340]

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

Parameters:
int   $p_category_id:  category id

API Tags:
Access:  public


[ 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

Parameters:
int   $p_project_id:  Project id
string   $p_name:  Category Name

API Tags:
Access:  public


[ Top ]
category_exists  [line 34]

bool category_exists( int $p_category_id  )

Check whether the category exists in the project

Parameters:
int   $p_category_id:  category id

API Tags:
Return:  Return true if the category exists, false otherwise
Access:  public


[ Top ]
category_full_name  [line 543]

string category_full_name( string $p_category_id, [bool $p_show_project = true]  )

Retrieves category name (including project name if required)

Parameters:
string   $p_category_id:  category id
bool   $p_show_project:  show project details

API Tags:
Return:  category full name
Access:  public


[ Top ]
category_get_all_rows  [line 388]

array category_get_all_rows( int $p_project_id, [bool $p_inherit = true], [bool $p_sort_by_project = false]  )

Return all categories for the specified project id.

Obeys project hierarchies and such.

Parameters:
int   $p_project_id:  Project id
bool   $p_inherit:  indicates whether to inherit categories from parent projects
bool   $p_sort_by_project: 

API Tags:
Return:  array of categories
Access:  public


[ Top ]
category_get_field  [line 490]

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.

Parameters:
int   $p_category_id:  category id
string   $p_name:  field name
   $p_field_name: 

API Tags:
Return:  field value
Access:  public


[ Top ]
category_get_id_by_name  [line 516]

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.

Parameters:
string   $p_category_name:  category name
int   $p_project_id:  project id
bool   $p_trigger_errors:  trigger error on failure

API Tags:
Access:  public


[ Top ]
category_get_name  [line 502]

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.

Parameters:
int   $p_category_id:  category id

API Tags:
Return:  category name
Access:  public


[ Top ]
category_get_row  [line 280]

array category_get_row( int $p_category_id  )

Return the definition row for the category

Parameters:
int   $p_category_id:  Category id

API Tags:
Return:  array containing category details
Access:  public


[ 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

Parameters:
int   $p_project_id:  project id
string   $p_name:  project name

API Tags:
Return:  Returns true if the category is unique, false otherwise
Access:  public


[ Top ]
category_remove  [line 183]

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

Remove a category from the project

Parameters:
int   $p_category_id:  Category id
int   $p_new_category_id:  new category id (to replace existing category)

API Tags:
Access:  public


[ Top ]
category_remove_all  [line 226]

bool category_remove_all( int $p_project_id, [int $p_new_category_id = 0]  )

Remove all categories associated with a project

Parameters:
int   $p_project_id:  Project ID
int   $p_new_category_id:  new category id (to replace existing category)

API Tags:
Access:  public


[ Top ]
category_sort_rows_by_project  [line 312]

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.

Parameters:
array   $p_category1:  array containing category details
array   $p_category2:  array containing category details

API Tags:
Return:  integer representing sort order
Access:  public


[ 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

Parameters:
int   $p_category_id:  Category id
string   $p_name:  Category Name
int   $p_assigned_to:  User ID that category is assigned to

API Tags:
Access:  public


[ Top ]


Documentation generated on Sun, 05 Apr 2009 23:01:00 +0100 by phpDocumentor 1.4.1