Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Trigger_Manager Class Reference
Inheritance diagram for Trigger_Manager:
Asset Bridge MySource_Object

Public Member Functions

 Trigger_Manager ($assetid=0)
 
 __wakeup ()
 
 create (Array &$link)
 
 _getAllowedLinks ()
 
 canClone ()
 
 _getName ($short_name=FALSE)
 
 _getComponentName ($type)
 
 _getComponentDescription ($type)
 
 getAsset ($shadowid, $type_code='', $mute_errors=FALSE)
 
 _createCategoryTriggerTree ($triggers)
 
 _findCategoryTriggerTree ($assetid, $trigger_tree)
 
 _getTopTriggerAssetMapLink ($parentid, $trigger_tree, &$links)
 
 getAssetMapLinks ()
 
 getAssetMapAssetInfo ($assetid)
 
 getLinks ($assetid, $link_types, $type_code='', $strict_type_code=TRUE, $side_of_link='major', $sort_by=NULL, $dependant=NULL, $exclusive=NULL)
 
 getParents ($assetid, $type_code='', $strict_type_code=TRUE)
 
 getChildren ($assetid, $type_code='', $strict_type_code=TRUE, $dependant=NULL, $sort_by=NULL)
 
 getLineageFromURL ($assetid, $protocol, $url)
 
 getPermission ($assetid, $permission, $granted=NULL, $and_greater=TRUE, $expand_groups=FALSE, $all_info=FALSE)
 
 setPermission ($assetid, $userid, $permission, $granted)
 
 deletePermission ($assetid, $userid, $permission)
 
 getAssetInfo ($assetids, $type_code=Array(), $strict_type_code=TRUE, $field='')
 
 assetExists ($assetids)
 
 getLink ($assetid, $link_type=NULL, $type_code='', $strict_type_code=TRUE, $value=NULL, $side_of_link='major', $exclusive=NULL)
 
 getLinkById ($linkid, $assetid=0, $side_of_link='major')
 
 countLinks ($assetid, $side_of_link='major', $link_types=0, $type_code='', $strict_type_code=TRUE, $ignore_linkid=0)
 
 getLinkByAsset ($assetid, $other_assetid, $link_types=NULL, $value=NULL, $side_of_link='major', $force_array=FALSE, $dependant=NULL, $exclusive=NULL)
 
 getAllChildLinks ($assetid, $link_type=0)
 
 updateLink ($linkid, $link_type=NULL, $value=NULL, $sort_order=NULL)
 
 deleteAssetLink ($linkid, $moving=FALSE)
 
 canCreateLink (Asset $minor, $link_type, $exclusive)
 
 createAssetLink (&$major, &$minor, $link_type, $value='', $sort_order=NULL, $dependant='0', $exclusive='0', $moving=FALSE)
 
 broadcastEvent ($event_name, &$broadcaster, $parameters=NULL)
 
 _calculateState ($event_type, &$event_broadcaster, $parameters=NULL)
 
 _calculateStateHash (&$state)
 
 _lookupCandidateTriggers ($state_hash=NULL)
 
 _executeTrigger ($trigger_data, &$state_data)
 
 _getHashObject ()
 
 _getEmptyTrigger ()
 
 _saveTrigger ($trigger)
 
 _saveTriggerHash ($hash=NULL)
 
 _prepareRawStateHash ($state_hash)
 
 _deleteTrigger ($trigger_id)
 
 _deleteTriggerHash ($trigger_id)
 
getTriggerList ()
 
 getTrigger ($triggerid)
 
 createTrigger (&$trigger)
 
 _loadTrigger ($trigger_id=NULL)
 
 _getTriggerInfoList ()
 
 _getComponentList ($type=NULL)
 
 _getEventList ()
 
 _getConditionList ()
 
 _getActionList ()
 
 _loadComponent ($type_code)
 
 _getComponentInterface ($type_code, $data, $prefix, $write_access=FALSE, Trigger $trigger=NULL, $action_id)
 
 _isMultipleConditionAllowed ($type_code)
 
 _isEventListenedFor ($event)
 
- Public Member Functions inherited from Asset
 Asset ($assetid=0)
 
 create (Array &$link)
 
 load ($assetid)
 
 _loadDataPaths ()
 
 reload ()
 
 canDelete ()
 
 delete ($release_lock=TRUE, $check_locked=TRUE)
 
 useSystemVersion ()
 
 loadSystemVersion ()
 
 saveSystemVersion ()
 
 clearSystemVersion ()
 
 revertToSystemVersion ()
 
 revertNoticeLinksToSystemVersion ()
 
 _updated ($update_parents=TRUE)
 
 type ()
 
 getTypeAncestors ($include_asset=TRUE)
 
 incrementVersion ($number='micro', $update_parents=TRUE)
 
 getLanguages ()
 
 setLanguages (Array $languages)
 
 setCharset ($charset)
 
 setForceSecure ($force_secure)
 
 remapAssetids (Array $map)
 
 morph ($new_type_code)
 
 _morphCleanup ($new_type_code)
 
 onRequestKeywords (Asset $broadcaster, Array $vars=Array())
 
 canClone ()
 
 cloneComponents (Asset $clone, Array $components, $override=FALSE)
 
 cloneComponentsAdditional (Asset $clone, Array $components)
 
 cloneLinks (Asset $clone)
 
 getStatus ()
 
 getAvailableStatii ()
 
 getStatusDescription ()
 
 processStatusChange ($new_status, $update_parents=TRUE, $run_updated=TRUE)
 
 setDate ($date_type, $time=NULL, $userid=NULL)
 
 lockTypes ()
 
 canForceablyAcquireLock ($lock_type)
 
 getEditingLocks ($keywords)
 
 _getAllowedLinks ()
 
 createLink (Asset $minor, $link_type, $value='', $sort_order=NULL, $dependant='0', $exclusive='0', $moving=FALSE, $locked=0)
 
 prepareLink (Asset $asset, $side_of_link, &$link_type, &$value, &$sort_order, &$dependant, &$exclusive)
 
 canCreateLink (Asset $minor, $link_type, $exclusive)
 
 canMoveLink (Asset $minor, Asset $old_major, $link_type)
 
 describeLink ($linkid)
 
 isDeletableLink ($linkid)
 
 canDeleteLink ($linkid)
 
 deleteLink ($linkid, $check_locked=TRUE)
 
 linksUpdated ()
 
 canCloneLink ()
 
 saveAttributes ($dont_run_updated=FALSE, $log_message=TRUE)
 
 setAttrValue ($name, $value)
 
 attr ($name)
 
attrByRef ($name)
 
 getAttribute ($name, $mute_errors=FALSE)
 
 getAssetKeywords ($descriptions=FALSE)
 
 getAvailableKeywords ()
 
 getKeywordReplacement ($keyword)
 
 getAssetWebPathKeywordReplacement ()
 
 getCustomKeywordReplacements ($keywords=Array(), $invoke_backend=FALSE)
 
 processCustomKeywords ($keywords=Array())
 
 getContent ()
 
 setContent ()
 
 getEffectiveLastUpdatedTime ($assetids)
 
 readAccess (Array $assetids=Array())
 
 writeAccess ($lock_type='', Array $assetids=Array(), $only_workflow=TRUE)
 
 adminAccess ($lock_type='', Array $assetids=Array())
 
 backendAccess ()
 
 liveEditAccess ($lock_type)
 
 canliveEdit ($lock_type)
 
 effectiveUnrestricted ()
 
 checkAccess ($perm, $lock_type, Array $assetids=Array(), $only_workflow=TRUE)
 
 accessEffective ()
 
 permissionsUpdated ()
 
 printFrontend ()
 
 printFrontendAsset (Asset $asset, $design=NULL)
 
 getValidProtocols ()
 
 printHead ()
 
 printBody ()
 
 getCurrentPaintLayoutName ()
 
 getCurrentDesignName ()
 
 printBodyWithPaintLayout ($layout_id='')
 
 initLimbo ()
 
 printLimbo ()
 
 paintBackend (Backend_Outputter $o)
 
 getPrefix ()
 
 processBackend (Backend_Outputter $o, Array &$link)
 
 getEI ()
 
 getEditFns ()
 
 getBackendHref ($screen='', $backend_page=TRUE)
 
 getURL ($base_url=NULL, $ignore_rollback=FALSE, $base_contextid=NULL)
 
 getURLs ()
 
 getHref ($base_url=NULL, $ignore_rollback=FALSE)
 
 getWebDataPath ()
 
 getWebPaths ()
 
 saveWebPaths ($paths, $auto_add_remaps=TRUE)
 
 getLookups ($field='')
 
 getDesignLookups ()
 
 getLookupValues ($inherited=NULL, $prefix='', $like_search=TRUE, $ignore_override=FALSE)
 
 deleteLookupValue ($layout_name, $layout_value)
 
 setPaintLayouts ($layouts)
 
 updateLookups ($auto_add_remaps=TRUE)
 
 setLookupValues (Array $values)
 
 getAssetStatusDescriptionKeywordReplacement ()
 
 getAssetStatusColourKeywordReplacement ()
 
 replaceKeywordsInString ($string)
 
 fastTrack ($tasks)
 
 unFastTrack ($tasks)
 
 shouldFastTrack ($task, $assetid=NULL)
 
 getFaskTrackedTaskAssetids ($task)
 
 getDependantParentsURL ()
 
- Public Member Functions inherited from MySource_Object
 MySource_Object ()
 
 __sleep ()
 
 __wakeup ()
 
- Public Member Functions inherited from Bridge
 getLinks ($assetid, $link_types, $type_code='', $strict_type_code=TRUE, $side_of_link='major', $sort_by=NULL)
 

Data Fields

 $_trigger_tree
 
- Data Fields inherited from Asset
 $id = 0
 
 $version = ''
 
 $name = ''
 
 $short_name = ''
 
 $status
 
 $languages = ''
 
 $charset = ''
 
 $force_secure = '0'
 
 $created
 
 $created_userid
 
 $updated
 
 $updated_userid
 
 $published
 
 $published_userid
 
 $status_changed
 
 $status_changed_userid
 
 $_is_cacheable = FALSE
 
 $vars = Array()
 
 $_available_keywords = Array()
 
 $data_path_suffix = ''
 
 $data_path = ''
 
 $data_path_public = ''
 
 $_ser_attrs = FALSE
 
- Data Fields inherited from MySource_Object
 $_tmp
 

Additional Inherited Members

- Protected Member Functions inherited from Asset
 _preCreateCheck (Array &$link)
 
 _createAdditional (Array &$link)
 
 _abortCreate ($trigger_level_changed=FALSE, $linkid=0)
 
 _loadVars ()
 
 _getName ($short_name=FALSE, $contextid=NULL)
 
 _getKeywordReplacement ($keyword)
 
 _checkPermissionAccess ($perm, $assetids=Array(), $only_workflow=TRUE)
 
 makeAndSaveInitialWebPath ($path, $parent_link=NULL)
 

Detailed Description

Definition at line 51 of file trigger_manager.inc.

Member Function Documentation

__wakeup ( )

Wakeup.

It's important to load components when restored from a serialised state by Deja Vu.

public

Definition at line 86 of file trigger_manager.inc.

_calculateState (   $event_type,
$event_broadcaster,
  $parameters = NULL 
)

Returns a state calculated from the event.

Parameters
string$event_typethe name of the event to calculate the state from
object&$event_broadcasterthe firing asset
array$parametersextra parameters
Returns
array private

Definition at line 1171 of file trigger_manager.inc.

_calculateStateHash ( $state)

Returns a state_hash calculated from the state

Parameters
array&$statethe state to calculate the hash from
Returns
array private

Definition at line 1235 of file trigger_manager.inc.

_createCategoryTriggerTree (   $triggers)

Creates a trigger tree from a list of triggers Trigger tree is used to display category hierarchy in asset map e.g $_trigger_tree['category1']['category2'][0] represents first trigger in category1/category2

Parameters
Array$triggersList of triggers to be processed
Returns
mixed Array|NULL private

Definition at line 282 of file trigger_manager.inc.

_deleteTrigger (   $trigger_id)

Deletes the trigger from trigger table and clears the hash entries

Parameters
int$trigger_idid of trigger to be deleted
Returns
boolean private

Definition at line 1857 of file trigger_manager.inc.

_deleteTriggerHash (   $trigger_id)

Removes all hash entries for a particular trigger ID

Parameters
int$trigger_idid of trigger whose hash is be deleted
Returns
boolean private

Definition at line 1889 of file trigger_manager.inc.

_executeTrigger (   $trigger_data,
$state_data 
)

Execute one trigger, using the passed trigger data and state info

Returns the status of the executed trigger

Parameters
array$trigger_datadetails (id, name, etc.) and data (actions, conditions) associated with the trigger
array&$state_datadata relating to the asset the trigger is running on
Returns
boolean private

Definition at line 1434 of file trigger_manager.inc.

_findCategoryTriggerTree (   $assetid,
  $trigger_tree 
)

Locates the branch in trigger tree for the specified category. It will recursively look for the category in the tree.

Parameters
String$assetidAsset id which contains the category to be searched.
Array$trigger_treeTrigger tree array.
Returns
mixed Array|NULL private

Definition at line 317 of file trigger_manager.inc.

_getActionList ( )

Get a list of installed actions

Returns
array private

Definition at line 2208 of file trigger_manager.inc.

_getAllowedLinks ( )

Return an array of all the permitted link types, the type asset and the cardinality

Returns
array private
See Also
Asset::_getAllowLinks()

Definition at line 140 of file trigger_manager.inc.

_getComponentDescription (   $type)

Returns the name of a component (an action or a condition)

Parameters
string$typecomponent type_code
Returns
string private

Definition at line 207 of file trigger_manager.inc.

_getComponentInterface (   $type_code,
  $data,
  $prefix,
  $write_access = FALSE,
Trigger  $trigger = NULL,
  $action_id 
)

Returns a string containing the buffered output of a component's edit interface

Parameters
string$type_codethe type_code of the component to get the interface of
array$datathe components settings data
string$prefixthe temporary unique ID for the component
boolean$write_accessthe write access status of the component
Returns
string private

Definition at line 2254 of file trigger_manager.inc.

_getComponentList (   $type = NULL)

Returns a list of descendants of a certain type, along with type info

Parameters
string$typethe type_code to get the descendants of
Returns
array private

Definition at line 2159 of file trigger_manager.inc.

_getComponentName (   $type)

Returns the name of a component (an action or a condition)

Parameters
string$typecomponent type_code
Returns
string private

Definition at line 191 of file trigger_manager.inc.

_getConditionList ( )

Get a list of installed conditions

Returns
array private

Definition at line 2195 of file trigger_manager.inc.

_getEmptyTrigger ( )

Return a blank trigger in preparation for editing

Returns
array private

Definition at line 1587 of file trigger_manager.inc.

_getEventList ( )

Get A list of all installed events

Returns
array private

Definition at line 2179 of file trigger_manager.inc.

_getHashObject ( )

Create and return an instance of hash object

Returns
object private

Definition at line 1573 of file trigger_manager.inc.

_getName (   $short_name = FALSE)

Return a name to use to describe this instance of the asset

Parameters
boolean$short_namewhether or not we are after the shortname or the full name
Returns
string private
See Also
Asset::_getName()

Definition at line 176 of file trigger_manager.inc.

_getTopTriggerAssetMapLink (   $parentid,
  $trigger_tree,
$links 
)

Returns all links in current level of trigger tree. Links will be created, sorted and passed to links array.

Parameters
String$parentidParent asset id which has all links in this level
Array$trigger_treeTrigger tree array.
Returns
mixed Array|NULL private

Definition at line 346 of file trigger_manager.inc.

_getTriggerInfoList ( )

Obtain a list of trigger info

Returns
array private

Definition at line 2123 of file trigger_manager.inc.

_isEventListenedFor (   $event)

Returns a list of triggerids for triggers that listen for a given event

Parameters
string$eventthe name of the event
Returns
boolean private

Definition at line 2290 of file trigger_manager.inc.

_isMultipleConditionAllowed (   $type_code)

Determines if more than one instance of a condition is allowed in the one trigger

Parameters
string$type_codethe type_code of the condition to check
Returns
boolean private

Definition at line 2273 of file trigger_manager.inc.

_loadComponent (   $type_code)

Load a component

NOTE: logic of this function can be pushed onto asset manager includeAsset could be modified to not throw an exception and return status if that change is ever made, conversion should be simple. Currently asset manager makes an assertion, which kills the system when trying to include something that is not installed

Parameters
string$type_codethe type_code of the component to load
Returns
boolean private

Definition at line 2229 of file trigger_manager.inc.

_loadTrigger (   $trigger_id = NULL)

Load Trigger Data

Parameters
int$trigger_idthe ID of the trigger to load
Returns
array private

Definition at line 2062 of file trigger_manager.inc.

_lookupCandidateTriggers (   $state_hash = NULL)

Lookup the State hash table for all triggers that might need executing

Parameters
array$state_hashThe hash used to check the database with
Returns
array private

Definition at line 1257 of file trigger_manager.inc.

_prepareRawStateHash (   $state_hash)

Format and return the state_hash

Parameters
array$state_hashthe state_hash to check
Returns
array private

Definition at line 1816 of file trigger_manager.inc.

_saveTrigger (   $trigger)

Prepare the trigger and state hash for saving, and ship them off to be saved

Returns trigger ID on success or FALSE on failure

Parameters
array$triggerthe trigger to be saved
Returns
int private

Definition at line 1611 of file trigger_manager.inc.

_saveTriggerHash (   $hash = NULL)

Saves the trigger hash in the database

Parameters
object$hashthe Hash object
Returns
boolean private

Definition at line 1752 of file trigger_manager.inc.

assetExists (   $assetids)

Determine if the passed assetid or assetids refer(s) to a valid asset in the system

Note that this will always return FALSE if you pass it a shadow asset

Parameters
mixed$assetidsthe ID of the asset we are going to the check for existence or an array of assetids we want to check
Returns
mixed boolean|array public

Definition at line 772 of file trigger_manager.inc.

broadcastEvent (   $event_name,
$broadcaster,
  $parameters = NULL 
)

Broadcasts an event, and run all the triggers associated with it

Parameters
string$event_namethe name of the event to broadcast
object&$broadcasterThe firing asset
array$parametersextra parameters
Returns
boolean public

Definition at line 1054 of file trigger_manager.inc.

canClone ( )

Return FALSE always because we don't want to be able to clone a trigger manager

Returns
boolean public

Definition at line 160 of file trigger_manager.inc.

canCreateLink ( Asset  $minor,
  $link_type,
  $exclusive 
)

Returns TRUE if the supplied assets can be linked in the specified way

Parameters
Asset$minorthe minor asset that we are linking to
string$link_typethe type of link this is
int$exclusivethe exclusive status of the link (gets passed to canLinkToType)
Returns
mixed boolean|string public

Definition at line 1011 of file trigger_manager.inc.

countLinks (   $assetid,
  $side_of_link = 'major',
  $link_types = 0,
  $type_code = '',
  $strict_type_code = TRUE,
  $ignore_linkid = 0 
)

Return the number of links in the system that involve the specified asset

Can be restricted by either link type afnd/or asset type code

Parameters
int$assetidid of the the $side_of_link asset
string$side_of_linkWhich side of the link this (the current) asset is on ('major' or 'minor')
int$link_typesinteger that can be the product of bitwise operations on the SQ_LINK_* constants
mixed$type_codethe type of asset that is linked (eg 'Page', 'File', etc) if an array returns link if matches any of the array values
boolean$strict_type_codewhether we are finding assets that are just a $type_code or $type_code and any of it's sub-classes
int$ignore_linkidignore the link represented by this link id when returning the count
Returns
int public

Implements Bridge.

Definition at line 896 of file trigger_manager.inc.

create ( Array &  $link)

Create this asset

Parameters
array&$linkinformation used to create the initial link
Returns
mixed int|boolean public
See Also
Asset::create()

Definition at line 105 of file trigger_manager.inc.

createAssetLink ( $major,
$minor,
  $link_type,
  $value = '',
  $sort_order = NULL,
  $dependant = '0',
  $exclusive = '0',
  $moving = FALSE 
)

Create a link between the two supplied assets

Parameters
object&$majorthe major asset that we are linking from
object&$minorthe minor asset that we are linking to
string$link_typethe type of link this is
string$valuethe value that is to be associated with this link
string$sort_orderthe position in the links list that this link should take, if NULL or less than zero places at end of list
string$dependant'0' / '1' - whether the minor asset is dependant on the major
string$exclusive'0' / '1' - whether the major asset is to be the minor's only parent
boolean$movingwhether or not this asset is being moved
Returns
int public

Definition at line 1034 of file trigger_manager.inc.

createTrigger ( $trigger)

Creates a trigger from data passed, and returns the id of the new trigger See Trigger_Manager::getTrigger() for a complete description of $trigger, except that new triggers do not require $trigger['id']

Parameters
int&$triggerthe id of the trigger to use to create the hash, null for all
Returns
int public
See Also
Trigger_Manager::getTrigger()

Definition at line 2006 of file trigger_manager.inc.

deleteAssetLink (   $linkid,
  $moving = FALSE 
)

Remove a link by id

Parameters
int$linkidthe link id of the link to remove
boolean$movingTRUE if this delete is part of a move operation
Returns
boolean public

Implements Bridge.

Definition at line 976 of file trigger_manager.inc.

deletePermission (   $assetid,
  $userid,
  $permission 
)

Deletes a permission with the passed user or user_group

Parameters
int$assetidthe assetid for asset whose permissions to delete
int$useridthe id of the user or user_group to remove the permission from
string$permissionthe permission code you are deleting
Returns
boolean public

Definition at line 686 of file trigger_manager.inc.

getAllChildLinks (   $assetid,
  $link_type = 0 
)

Get details of the links from the specified asset to all its children

Parameters
string$assetidthe assetid of the asset to find the child links for
int$link_typethe type of links to get
Returns
array public

Definition at line 939 of file trigger_manager.inc.

getAsset (   $shadowid,
  $type_code = '',
  $mute_errors = FALSE 
)

Returns a reference to the asset represented by the passed assetid

Parameters
mixed$shadowid(int | string) the asset id to be loaded
string$type_codeif this exists then this object is used to load the asset, if not then the DB is queried to find out the asset type
boolean$mute_errorsstops the outputting of errors in this fn, needed because you can't use the '@' operator when returning by reference
Returns
mixed object|NULL public

Implements Bridge.

Definition at line 230 of file trigger_manager.inc.

getAssetInfo (   $assetids,
  $type_code = Array(),
  $strict_type_code = TRUE,
  $field = '' 
)

Returns an array of information about assets of the passed codes

If one value in $field then the return value is Array(assetid => '[field]'), otherwise Array(assetid => Array())

Parameters
array$assetidsan array of assets to limit
mixed$type_codean asset type code, or array of typecodes, to limit results to
boolean$strict_type_codeensure returned assets are of the passed type codes
string$fieldsingle field from the asset table to return (along with the assetid) Default is all fields
Returns
array public

Definition at line 707 of file trigger_manager.inc.

getAssetMapAssetInfo (   $assetid)

Get asset info for use by asset map

Parameters
string$assetidFull Asset id to get information for
Returns
array public

Implements Bridge.

Definition at line 474 of file trigger_manager.inc.

getAssetMapLinks ( )

Used by asset map to return a asset map-style link array

Returns
array|NULL public

Definition at line 447 of file trigger_manager.inc.

getChildren (   $assetid,
  $type_code = '',
  $strict_type_code = TRUE,
  $dependant = NULL,
  $sort_by = NULL 
)

Get all asset ids that are below the passed assetid in the various trees in which it exists

Parameters
int$assetidthe id of the asset to get its children for
mixed$type_codethe type of asset that is linked (eg 'Page', 'File', etc) if an array returns link if matches any of the array values
boolean$strict_type_codewhether we are finding assets that are just a $type_code or $type_code and any of it's sub-classes
boolean$dependantif TRUE, results will be filtered to assets that are dependants. If FALSE, results will all not be dependants. If NULL, results will not be filtered
string$sort_bya field in the asset table you would like the results sorted by (eg. name, short_name etc)
Returns
array public
See Also
Asset_Manager::getChildren()

Implements Bridge.

Definition at line 606 of file trigger_manager.inc.

getLineageFromURL (   $assetid,
  $protocol,
  $url 
)

Returns an array of assetid's + info in the order that they propogate out from THIS BRIDGE'S url

Parameters
string$assetidthe id of the last asset in the lineage
string$protocolthe protocol to match -> NULL means it is ignored
string$urlthe url to check for -> NULL defaults it to current url
Returns
array public

Implements Bridge.

Definition at line 623 of file trigger_manager.inc.

getLink (   $assetid,
  $link_type = NULL,
  $type_code = '',
  $strict_type_code = TRUE,
  $value = NULL,
  $side_of_link = 'major',
  $exclusive = NULL 
)

Get details of a link with the specified characteristics

Parameters
int$assetidid of the the $side_of_link asset
int$link_typeinteger that should be a single integer of the SQ_LINK_* constants
mixed$type_codethe type of asset that is linked (eg 'Page', 'File', etc) if an array returns link if matches any of the array values
boolean$strict_type_codewhether we are finding an asset that is just a $type_code or potentially an inherited type or $type_code and any of it's sub-classes
string$valuethe value that is associated with this link
string$side_of_linkWhich side of the link this (the current) asset is on ('major' or 'minor')
boolean$exclusiveThe exclusive status for the link must be this (if not NULL)
Returns
array public

Definition at line 800 of file trigger_manager.inc.

getLinkByAsset (   $assetid,
  $other_assetid,
  $link_types = NULL,
  $value = NULL,
  $side_of_link = 'major',
  $force_array = FALSE,
  $dependant = NULL,
  $exclusive = NULL 
)

Get details of the link(s) between the two specified assets

Parameters
int$assetidid of the the $side_of_link asset
int$other_assetidthe asset on the other side of the link
int$link_typesinteger that can be the product of bitwise operations on the SQ_LINK_* constants
string$valuethe value that is associated with this link
string$side_of_linkWhich side of the link the first assetid is on ('major' or 'minor')
boolean$force_arrayforce the results to return an array of links even if there is only one link
boolean$dependantThe dependant status for all the links must be this (if not null)
boolean$exclusiveThe exclusive status for all the links must be this (if not null)
Returns
array public

Definition at line 923 of file trigger_manager.inc.

getLinkById (   $linkid,
  $assetid = 0,
  $side_of_link = 'major' 
)

Get details of the link with specified linkid

Parameters
int$linkidid of the link were returning
int$assetidid of the the $side_of_link asset if zero no check is made and both major and minor information is returned
string$side_of_linkWhich side of the link the asset represented by $assetid is on ('major' or 'minor')
Returns
array public

Definition at line 818 of file trigger_manager.inc.

getLinks (   $assetid,
  $link_types,
  $type_code = '',
  $strict_type_code = TRUE,
  $side_of_link = 'major',
  $sort_by = NULL,
  $dependant = NULL,
  $exclusive = NULL 
)

Return all links that this asset has to other assets

Parameters
int$assetidid of the the $side_of_link asset
int$link_typesinteger that can be the product of bitwise operations on the SQ_LINK_* constants
mixed$type_codethe type of asset that is linked (eg 'Page', 'File', etc) if an array returns link if matches any of the array values
boolean$strict_type_codewhether we are finding assets that are just a $type_code or $type_code and any of it's sub-classes
string$side_of_linkWhich side of the link this (the current) asset is on ('major' or 'minor')
string$sort_bya field in the asset table you would like the results sorted by (eg. name, short_name etc)
boolean$dependantWhether we want dependant links, non-dependent or (NULL) don't care
boolean$exclusiveWhether we want exclusive links, non-exclusive or (NULL) don't care
Returns
array public
See Also
Asset_Manager::getLinks()

Definition at line 540 of file trigger_manager.inc.

getParents (   $assetid,
  $type_code = '',
  $strict_type_code = TRUE 
)

Get all asset ids that are above the passed assetid in the various trees in which it exists

Can only find parents of type user_group

Parameters
int$assetidthe id of the asset to get its parents for
mixed$type_codethe type of asset that is linked (eg 'User', 'User_Group', etc) if an array returns link if matches any of the array values
boolean$strict_type_codewhether we are finding assets that are just a $type_code or $type_code and any of it's sub-classes
Returns
array public
See Also
Asset_Manager::getParents()

Implements Bridge.

Definition at line 579 of file trigger_manager.inc.

getPermission (   $assetid,
  $permission,
  $granted = NULL,
  $and_greater = TRUE,
  $expand_groups = FALSE,
  $all_info = FALSE 
)

Returns an array of all user or user_group assets that have the passed permission for the passed asset

Parameters
int$assetidthe assetid for asset whose permissions to get
string$permissionthe permission code you are getting
boolean$grantedtype of Access : NULL = all, TRUE = granted, FALSE = denied
boolean$and_greaterget effective permission (eg read access = read or write or admin)
boolean$expand_groupsexpand user groups so only user ids get returned (NOTE: only valid if $all_info is FALSE)
boolean$all_infowhen FALSE fn just returns an array of userids for those that have permission When TRUE fn returns all info about the permission in the form of Array(userid => granted) (NOTE: TRUE is only valid if $and_greater and $expand_groups are FALSE)
Returns
array public

Definition at line 650 of file trigger_manager.inc.

getTrigger (   $triggerid)

Returns a trigger with the passed ID

Array(
  'id'          => integer,         // the triggerid
  'name'            => string,          // the name of the trigger
  'description' => string,          // a description of the trigger
  'active'      => boolean,         // on/off switch for each trigger
  'data'            => Array(
                    'events'        => Array(
                                        'event_name'    => 'event_name',
                                       ),
                    'conditions'    => Array(
                                        int => Array(
                                                'type'  => string                           // the type_code of the condition
                                                'data'  => Array(mixed)                     // condition-specific data
                                               ),
                                       ),
                    'actions'       => Array(
                                        int => Array(
                                                'type'                  => string           // the type_code of the condition
                                                'data'                  => Array(mixed)     // condition-specific data
                                                'not_required'          => boolean          // if true, if the action fails, the trigger will continue to run
                                                'ignore_permissions'    => boolean          // whether to run with elevated privileges
                                               ),
                                       ),
                    'settings'      => Array(
                                        'blocking'  => boolean,     // if true, then if this trigger fails it will halt the
                                                                    // execution of any further triggers scheduled to run
                                       ),
                   ),
)
Parameters
int$triggeridThe id of the trigger to retrieve
Returns
array public

Definition at line 1984 of file trigger_manager.inc.

& getTriggerList ( )

Returns a list of all the triggers, including data See Trigger_Manager::getTrigger() for a complete description of the return format

Returns
array public
See Also
Trigger_Manager::getTrigger()

Definition at line 1928 of file trigger_manager.inc.

setPermission (   $assetid,
  $userid,
  $permission,
  $granted 
)

Sets a permission for the passed user or user_group

Parameters
int$assetidthe assetid for asset whose permissions to set
int$useridthe id of the user or user_group to add the permission for
string$permissionthe permission code you are adding
boolean$grantedwhether this permission grants access or not
Returns
boolean public

Definition at line 669 of file trigger_manager.inc.

Trigger_Manager (   $assetid = 0)

Constructor

Parameters
int$assetidthe asset id to be loaded public

Definition at line 66 of file trigger_manager.inc.

updateLink (   $linkid,
  $link_type = NULL,
  $value = NULL,
  $sort_order = NULL 
)

Update the details of an existing link

If any of the detail vars are NULL they are not updated.

Parameters
int$linkidthe link id of the link to update
int$link_typethe type of the link (one of the SQ_LINK_* constants)
string$valuethe value to place on the link
int$sort_orderthe position in the links list that this link should take, if less than zero places at end of list
Returns
boolean public

Definition at line 960 of file trigger_manager.inc.


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