modules/Trackers/BreadCrumbStack.php

Show: inherited
Table of Contents

\BreadCrumbStack

Package:

Properties

Propertyprivatevoid  $deleteInvisible= 'false'

Boolean flag to determine whether or not entries not visible should be removed

Default valuefalseDetails
Type
n/a
Propertyprivate\unknown_type  $stack= ''

Maintain an ordered list of items in the breadcrumbs

Details
Type
\unknown_type
Propertyprivate\unknown_type  $stackMap= ''

Maps an item_id to the position index in stack

Details
Type
\unknown_type

Methods

methodpublicBreadCrumbStack( \$user_id $user_id, \$modules $modules = '' ) : void

BreadCrumbStack Constructor for BreadCrumbStack that builds list of breadcrumbs using tracker table

Parameters
Name Type Description
$user_id \$user_id

String value of user id to get bread crumb items for

$modules \$modules

mixed value of module name(s) to provide extra filtering

methodprivateaddItem( array $row ) : void

Add an item to the stack

Parameters
Name Type Description
$row array
  • the row from the db query
methodpubliccontains( \item_id $item_id ) : \id

contains Returns true if the stack contains the specified item_id, false otherwise.

Parameters
Name Type Description
$item_id \item_id

the item id to search for

Returns
Type Description
\id of the first item on the stack
methodpublicgetBreadCrumbList(  $filter_module = '' ) : array

Return the list of breadcrubmbs currently in memory

Parameters
Name Type Description
$filter_module
Returns
Type Description
array of breadcrumbs
methodprivateheal( ) : void

Once we have removed an item from the stack we need to be sure to have the ids and indices match up properly. Heal takes care of that. This method should only be called when an item_id is already in the stack and needs to be removed

methodpubliclength( ) : int

Return the number of elements in the stack

Returns
Type Description
int - the number of elements in the stack
methodprivatemakeItemInvisible( int $id ) : void

Change the visibility of an item

Parameters
Name Type Description
$id int
methodpublicpop( ) : void

Pop an item off the stack

methodpublicpopItem( string $item_id ) : void

Pop an Item off the stack. Call heal to reconstruct the indices properly

Parameters
Name Type Description
$item_id string
  • the item id to remove from the stack
methodpublicpush( array $row ) : void

Push an element onto the stack.

This will only maintain a list of unique item_ids, if an item_id is found to already exist in the stack, we want to remove it and update the database to reflect it's visibility.

Parameters
Name Type Description
$row array
  • a trackable item to store in memory
Documentation was generated by DocBlox 0.18.1.