Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Hash Class Reference

Public Member Functions

 Hash ()
 
 isEmpty ()
 
 _set ($name, $value)
 
 setEvent ($event)
 
 setAssetId ($assetid)
 
 setAssetType ($asset_type, $descendants=FALSE)
 
 setLinkTree ($tree_id, $propagation)
 
 setTriggerId ($trigger_id)
 
 setLinkedId ($linked_id, $is_major)
 
 setLinkedType ($linked_type, $is_major)
 
 getHashCombinations ()
 
 _createCombinations ($source)
 

Data Fields

 $hash
 
 $tree_propagation
 

Detailed Description

Definition at line 28 of file hash.inc.

Member Function Documentation

_createCombinations (   $source)

Given an array of elements of various depth, creates all possible combinations of the elements, preserving the index Given: $source = Array(1=>Array('a','b'), 2=>'c', 3=>Array('d')); $result = Array(Array(1=>'a',2=>'c',3=>'d'), Array(1=>'b',2=>'c',3=>'d')); This function can be called statically returns Array(mixed) $state_hash The flattened state_hash

NOTE: Can only create combinations for arrays two levels deep

Parameters
array$sourceThe hash to flatten
Returns
array private

Definition at line 309 of file hash.inc.

_set (   $name,
  $value 
)

Internal function for setting the value of a hash field

Parameters
string$namevariable to modify
mixed$valuevalue that the variable will be set to
Returns
void private

Definition at line 91 of file hash.inc.

getHashCombinations ( )

Takes the hash, checks it for empty fields filling in the blanks where necessary, and creates all possible combinations of its elements

Returns
void public

Definition at line 251 of file hash.inc.

Hash ( )

Allowed Hash Indices

    event
    assetid
    asset_type
    treeid
    tree_propagate
    triggerid
    parentid
    parent_type
    childid
    child_type

Constructor

Definition at line 61 of file hash.inc.

isEmpty ( )

Provides a status of whether this hash object is empty or not

Returns
boolean public

Definition at line 75 of file hash.inc.

setAssetId (   $assetid)

Sets the AssetID field

Parameters
string$assetidthe id of the asset
Returns
void public

Definition at line 131 of file hash.inc.

setAssetType (   $asset_type,
  $descendants = FALSE 
)

Sets the Asset Type field

Parameters
string$asset_typethe type of the asset
boolean$descendantswhether the hash will include the type's descendants, or just the passed asset type
Returns
void public

Definition at line 147 of file hash.inc.

setEvent (   $event)

Sets the Event field

Parameters
string$eventthe name of the event that was fired
Returns
void public

Definition at line 116 of file hash.inc.

setLinkedId (   $linked_id,
  $is_major 
)

Sets either the parent or child ID field of the Linked asset

Parameters
string$linked_idthe ID of the linked asset
boolean$is_majorwhether the linked asset is a parent or a child
Returns
void public

Definition at line 213 of file hash.inc.

setLinkedType (   $linked_type,
  $is_major 
)

Sets either the parent or child Type field of the Linked asset

Parameters
string$linked_typethe type_code of the linked asset
boolean$is_majorwhether the linked asset is a parent or a child
Returns
void public

Definition at line 233 of file hash.inc.

setLinkTree (   $tree_id,
  $propagation 
)

Sets the Asset Type field

Parameters
string$tree_idthe raw link tree id of the asset (see asset_manager::getAssetTreeids)
string$propagation'01' or '00'. Determines whether the we are checking for assets underneath a tree node, or just for an individual asset
Returns
void public

Definition at line 177 of file hash.inc.

setTriggerId (   $trigger_id)

Sets the Trigger ID field

Parameters
string$trigger_idthe ID of the trigger
Returns
void public

Definition at line 197 of file hash.inc.


The documentation for this class was generated from the following file: