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

Public Member Functions

 __construct ($assetid=0)
 
 _getName ($short_name=FALSE)
 
 _getAllowedLinks ()
 
 getAsset ($shadowid, $type_code='', $mute_errors=FALSE)
 
 getLinks ($assetid, $link_types, $type_code='', $strict_type_code=TRUE, $side_of_link='major', $sort_by=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)
 
 countLinks ($assetid, $side_of_link='major', $link_types=0, $type_code='', $strict_type_code=TRUE, $ignore_linkid=0)
 
 deleteAssetLink ($linkid, $moving=FALSE)
 
 getAssetMapLinks ()
 
 getAssetMapAssetInfo ($assetid)
 
 prepareLink (Asset $asset, $side_of_link, &$link_type, &$value, &$sort_order, &$dependant, &$exclusive)
 
 getStatus ()
 
 onAssetStatusUpdate (Asset $broadcaster, $event_vars)
 
 readAccess (Array $assetids=Array())
 
 canCreateLink (Asset $minor, $link_type, $exclusive)
 
 createLink (Asset $minor, $link_type, $value='', $sort_order=NULL, $dependant='0', $exclusive='0', $moving=FALSE)
 
 getAllBundleStreams ()
 
 getAllBypassableBundleStreams ()
 
 isDefaultStreamBypassable ()
 
- 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 ()
 

Additional Inherited Members

- 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
 
- 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 35 of file workflow_bundle.inc.

Constructor & Destructor Documentation

__construct (   $assetid = 0)

Constructor

Parameters
int$assetidthe asset id to be loaded

Definition at line 45 of file workflow_bundle.inc.

Member Function Documentation

_getAllowedLinks ( )

Returns an array of all the permitted links type, the type asset and the cardinality

Returns
array private
See Also
Asset::_getAllowLinks()

Definition at line 74 of file workflow_bundle.inc.

_getName (   $short_name = FALSE)

Returns the name of the asset

Parameters
boolean$short_nameTRUE = return short name; FALSE = return full name
Returns
string public

Definition at line 60 of file workflow_bundle.inc.

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

Returns TRUE if the passed minor asset can be linked to this asset, or a string with the error msg

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 601 of file workflow_bundle.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 and/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) (can be a string or an array of strings) 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 232 of file workflow_bundle.inc.

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

Creates a link between this asset and the passed asset, of a certain type and returns the linkid of the created link

Parameters
Asset$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' on whether the this asset is dependant on the asset that will be linked by this new link
string$exclusive'0' / '1' on whether the this asset is linked exclusivly to the asset that will be linked by this new link
boolean$movingmoving
Returns
int public
See Also
Asset_Manager::createAssetLink()

Definition at line 635 of file workflow_bundle.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 248 of file workflow_bundle.inc.

getAllBundleStreams ( )

Returns all available workflow streams in bundled assets, EXCEPT default streams

Array is of (stream_assetid => stream name)

Returns
boolean

Definition at line 657 of file workflow_bundle.inc.

getAllBypassableBundleStreams ( )

Returns all available workflow streams in bundled assets that would be bypassable in ALL of our bundled assets

Returns
array

Definition at line 692 of file workflow_bundle.inc.

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

Returns a reference to the asset represented by the passed assetid

Nothing doing here. We aren't providing shadow assets to y'all, so go away.

Parameters
int$shadowidthe shadow part asset id to be loaded (i.e part after the ':')
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
See Also
Asset_Manager::&getAsset()

Implements Bridge.

Definition at line 104 of file workflow_bundle.inc.

getAssetMapAssetInfo (   $assetid)

Get asset info for use by asset map

Should return an array containing the following elements:

  • assetid: ID of the asset.
  • name: Full name of the asset.
  • short_name: Short name of the asset.
  • version: Asset version number.
  • status: Current status of the asset.
  • type_code: The type code of the shadow asset.
  • num_kids: Number of children, if known.
  • accessible: Whether the asset should be accessible.
  • url: URL for this lineage of the asset, if known.
  • web_path: Web path for this lineage of the asset, if known.

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

Implements Bridge.

Definition at line 342 of file workflow_bundle.inc.

getAssetMapLinks ( )

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

We need to implement this so our NOTICE links are shown in the asset map.

Returns
array public

Definition at line 264 of file workflow_bundle.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

Returns an array of assetids and their type code

I believe that this relates to structural links underneath us (cf. Search Folder). So this should be empty no matter what, since we only have NOTICE links.

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 185 of file workflow_bundle.inc.

getLineageFromURL (   $assetid,
  $protocol,
  $url 
)

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

No URLs to propagate here, since we have no structural links that we need to provide lookups for.

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 205 of file workflow_bundle.inc.

getLinks (   $assetid,
  $link_types,
  $type_code = '',
  $strict_type_code = TRUE,
  $side_of_link = 'major',
  $sort_by = 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)
Returns
array public
See Also
Asset_Manager::getLinks()

Implements Bridge.

Definition at line 132 of file workflow_bundle.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

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 152 of file workflow_bundle.inc.

getStatus ( )

Returns a status object for the current asset to be used for processing

This is generally the same as the method in Asset itself, bar the subtle difference of it getting one of the Bundle status objects instead.

Returns
Asset_Status public

Definition at line 413 of file workflow_bundle.inc.

isDefaultStreamBypassable ( )

Is the default stream of all bundled assets bypassable?

Returns
boolean

Definition at line 716 of file workflow_bundle.inc.

onAssetStatusUpdate ( Asset  $broadcaster,
  $event_vars 
)

Event listener for bundled assets cancelling their workflow

If any asset is rejected, any other bundled asset in workflow should be rolled back, as well as the bundle itself.

Note: status changes to the bundle are done with status integrity turned off because a normal user could not actually do these changes. Once the last asset with workflow is completed, the user then has no access to status changes.

Parameters
Asset$broadcasterThe broadcasting asset
array$event_varsAny event variables sent by the broadcaster
Returns
void

Definition at line 444 of file workflow_bundle.inc.

prepareLink ( Asset  $asset,
  $side_of_link,
$link_type,
$value,
$sort_order,
$dependant,
$exclusive 
)

Prepares for linking by checking that the link values are valid for this link

This function will be called if this asset is the major or minor party in the link, so the side_of_link flag should be checked to work out what side of the link this asset is on. The return value should indicate if any of the link fields were changed.

Parameters
Asset$assetthe major or minor asset that we are linking to
string$side_of_linkthe side of the link we are on (major or minor)
string&$link_typethe type of link we are creating
string&$valuethe value that is to be associated with the link
string&$sort_orderthe position in the links list that this link should take,
string&$dependant'0' / '1' on whether the this asset is dependant on the asset that will be linked by the new link
string&$exclusive'0' / '1' on whether the this asset is linked exclusivly to the asset that will be linked by the new link
Returns
boolean public

Definition at line 390 of file workflow_bundle.inc.

readAccess ( Array  $assetids = Array())

Returns TRUE if at least one of the passed assetids has read access to this asset

Parameters
array$assetidsAn array of user_group and/or user ids to check for read access If the array is empty, the current user will be checked
Returns
boolean public

Definition at line 570 of file workflow_bundle.inc.


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