PHP Class Categories_library, 68kb

Show file Open project: 68kb/68kb

Protected Properties

Property Type Description
$_all_cats
$_cat_ids
$_categories
$_ci

Public Methods

Method Description
__construct ( ) Constructor
category_tree ( $data = [], $id = 'cat_id', $parent = 'cat_parent' ) Category Tree
clear_ids ( ) Clear ids
get_categories ( ) : array Get Categories
get_child_ids ( $parent ) Get Child Category Ids
get_ids ( ) : array Get ids
make_list ( $data, $options = [] ) Make a list of categories

Private Methods

Method Description
_category_subtree ( $cat_id, $cat_array, $depth ) Category Sub Tree
_child_subtree ( $cat_id, $cat_array, $depth ) Generate the child ids for the parent.
_walk_categories ( $parent_id, $menu_data, $options, $start ) Walk though the array

Method Details

__construct() public method

Constructor
public __construct ( )

category_tree() public method

Get categories in an array
public category_tree ( $data = [], $id = 'cat_id', $parent = 'cat_parent' )

clear_ids() public method

Clear out the category ids so they do not overlap.
public clear_ids ( )

get_categories() public method

Get the full array of categories
public get_categories ( ) : array
return array

get_child_ids() public method

Get a list of all child categories in an array
public get_child_ids ( $parent )

get_ids() public method

Get the array of category ids
public get_ids ( ) : array
return array

make_list() public method

Make a list of categories
public make_list ( $data, $options = [] )

Property Details

$_all_cats protected property

protected $_all_cats

$_cat_ids protected property

protected $_cat_ids

$_categories protected property

protected $_categories

$_ci protected property

protected $_ci