\midcom_helper_nav_itemlist

Itemlist abstract base class

You have to implement the get_sorted_list member, it has to return an array sorted by the constraints you establish.

Summary

Methods
Properties
Constants
__construct()
get_sorted_list()
factory()
No public properties found
No constants found
get_nodes()
get_leaves()
$_nap
$parent_node_id
N/A
No private methods found
No private properties found
N/A

Properties

$parent_node_id

$parent_node_id : 

Type

Methods

__construct()

__construct(\midcom_helper_nav  $nap, integer  $parent_topic_id) 

Initialize the object, used by the factory function.

Parameters

\midcom_helper_nav $nap

NAP object to use.

integer $parent_topic_id

An ID of the topic in which we operate.

get_sorted_list()

get_sorted_list() : Array

Returns the sorted list for this topic according to our sorting criteria.

It has to be overridden. Throw midcom_error on any critical failure.

Returns

Array —

An array of all objects.

factory()

factory(string  $sorting, \midcom_helper_nav  $nap, integer  $parent_topic) : \midcom_helper_nav_itemlist

Generate the object you want to use for getting a list of items for a certain topic.

Use this function to create sorted lists. Example: $nav_object = midcom_helper_nav_itemlist::factory($navorder, $this, $parent_topic); $result = $nav_object->get_sorted_list(); print_r($result); // shows: array (1 => array ( MIDCOM_NAV_ID => someid, MIDCOM_NAV_NAME => somename, MIDCOM_NAV_STYLE => false ) ); Note that most searchstyles do not bother with styles. But it is useful for custom classes.

Parameters

string $sorting

sorttype (e.g. topicsfirst)

\midcom_helper_nav $nap

pointer to the NAP object.

integer $parent_topic

pointer to the topic to base the list on.

Returns

\midcom_helper_nav_itemlist

get_nodes()

get_nodes() : array

Returns

array

get_leaves()

get_leaves() : array

Returns

array