modules/Trackers/BreadCrumbStack.php
\BreadCrumbStack
Properties
void
$deleteInvisible= 'false'
Boolean flag to determine whether or not entries not visible should be removed
false
Details- Type
- n/a
\unknown_type
$stack= ''
Maintain an ordered list of items in the breadcrumbs
- Type
- \unknown_type
Methods
BreadCrumbStack(
\$user_id $user_id, \$modules $modules
=
''
)
:
void
BreadCrumbStack Constructor for BreadCrumbStack that builds list of breadcrumbs using tracker table
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 |
addItem(
array $row
)
:
void
Add an item to the stack
Name | Type | Description |
---|---|---|
$row | array |
|
contains(
\item_id $item_id
)
:
\id
contains Returns true if the stack contains the specified item_id, false otherwise.
Name | Type | Description |
---|---|---|
$item_id | \item_id | the item id to search for |
Type | Description |
---|---|
\id | of the first item on the stack |
getBreadCrumbList(
$filter_module
=
''
)
:
array
Return the list of breadcrubmbs currently in memory
Name | Type | Description |
---|---|---|
$filter_module |
Type | Description |
---|---|
array | of breadcrumbs |
heal(
)
:
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
length(
)
:
int
Return the number of elements in the stack
Type | Description |
---|---|
int | - the number of elements in the stack |
makeItemInvisible(
int $id
)
:
void
Change the visibility of an item
Name | Type | Description |
---|---|---|
$id | int |
popItem(
string $item_id
)
:
void
Pop an Item off the stack. Call heal to reconstruct the indices properly
Name | Type | Description |
---|---|---|
$item_id | string |
|
push(
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.
Name | Type | Description |
---|---|---|
$row | array |
|