68 Classifieds API

Features
class tree: 68Classifieds | index: 68Classifieds | all elements

 Class Categories

Description

Categories class handles everything for the categories.

Located in /includes/classes/kernel/Categories.php (line 21)


	
			
Method Summary
 true addCategory (array $data)
 array breadcrumb (int $node, int $lev)
 array breadcrumb_title (int $node, int $lev)
 boolean checkSlug (string $slug, [ $id = FALSE])
 true deleteCategory (int $id)
 true editCategory (array $data)
 string formatSlug (string $slug, [ $i = 0], [ $id = FALSE])
 array getAdminCatTree (string $prefix, int $parent, [ $listing_total = FALSE])
 mixed getAllCategories ()
 void getCategoryById (int $id)
 void getCategoryBySlug (string $slug)
 str getCategoryNameById (int $id)
 int getCatListingsByCatID (int $id)
 array getCatTree (string $prefix, int $parent)
 array getSubCategories (int $parent)
 string getSubCategoriesList (int $parent, [int $limit = 3])
 int get_count (array $arr_ids)
 array get_ids (arrary $arr_ids)
 True removeCatImage (int $id)
 array required_cats ()
 array selected_cat_tree (string $prefix, int $parent, int $modify)
Methods
addCategory (line 326)

Add Category

  • return: on success.
true addCategory (array $data)
  • array $data: An array of data.
breadcrumb (line 271)

Breadcrumb

Generates a breadcrumb nav for categories

array breadcrumb (int $node, int $lev)
  • int $node: The current category id
  • int $lev: The current level
breadcrumb_title (line 305)

Breadcrumb

Generates a breadcrumb for a page title

array breadcrumb_title (int $node, int $lev)
  • int $node: The current category id
  • int $lev: The current level
checkSlug (line 208)

Check Slug

Checks other categories for the same slug.

  • return: True if checks out ok, false otherwise
boolean checkSlug (string $slug, [ $id = FALSE])
  • string $slug: The slug name
  • $id
deleteCategory (line 400)

Delete Category

  • return: on success.
true deleteCategory (int $id)
  • int $id: The id of the category to delete.
editCategory (line 366)

Edit Category

  • return: on success.
true editCategory (array $data)
  • array $data: An array of data.
formatSlug (line 241)

Format Slug

Formats a category slug.

  • return: A cleaned slug
string formatSlug (string $slug, [ $i = 0], [ $id = FALSE])
  • string $slug: The slug name
  • $i
  • $id
getAdminCatTree (line 439)

Get Administration Category Tree

array getAdminCatTree (string $prefix, int $parent, [ $listing_total = FALSE])
  • string $prefix
  • int $parent: The parend category id
  • $listing_total
getAllCategories (line 613)

Get all data for all categories

  • return: false on failure array on success
  • access: public
mixed getAllCategories ()
getAllParentCategories (line 523)

Get All Parent Categories

  • access: public
array getAllParentCategories ()
getCategoryById (line 565)

Get Category

Gets a single category by its ID. Then assigns it to the template class.

  • global: object db $db: Database functions
  • global: object class_tpl $class_tpl: Template functions
  • access: public
void getCategoryById (int $id)
  • int $id: The listing id to get.
getCategoryBySlug (line 178)

Get Category by Slug

Gets the category based off it's slug

void getCategoryBySlug (string $slug)
  • string $slug: return array
getCategoryNameById (line 597)

Get a category name by its id.

  • return: Category name
  • access: public
str getCategoryNameById (int $id)
  • int $id: The category id.
getCatListingsByCatID (line 422)

Get Listings By Category Id

  • return: Number of rows.
int getCatListingsByCatID (int $id)
  • int $id: The category id
getCatTree (line 466)

Get Category Tree

array getCatTree (string $prefix, int $parent)
  • string $prefix
  • int $parent: The parend category id
getSubCategories (line 29)

Get Sub Categories

array getSubCategories (int $parent)
  • int $parent: The parent category id.
getSubCategoriesList (line 86)

Get Sub Categories List

string getSubCategoriesList (int $parent, [int $limit = 3])
  • int $parent: The parent category id.
  • int $limit: The number to limit. Default is 3.
get_count (line 160)

Get Count Count the total listings in an array of categories.

  • return: Total
int get_count (array $arr_ids)
  • array $arr_ids
get_ids (line 124)

Get Ids

Recurrsively get the child category ids from a parent.

array get_ids (arrary $arr_ids)
  • arrary $arr_ids: An array of ids.
removeCatImage (line 659)

Remove Category Image

  • return: on success
  • global: object db $db: Database functions
  • access: public
True removeCatImage (int $id)
  • int $id: The category id
required_cats (line 637)

Required Categories

  • global: object db $db: Database functions
array required_cats ()
selected_cat_tree (line 490)

Selected Category Tree

array selected_cat_tree (string $prefix, int $parent, int $modify)
  • string $prefix
  • int $parent: The parend category id
  • int $modify: modify The field id