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

Public Member Functions

 Thesaurus ($assetid=0)
 
 delete ($release_lock)
 
 _createAdditional (&$link)
 
 getAbbreviations ()
 
 getSynonymsForTerm ($term)
 
 getChildTerms ($termid, $relid=NULL)
 
 countChildTerms ($termid)
 
 countTermLinks ()
 
 countTerms ()
 
 countParentTerms ($termid)
 
 getChildRelationsForTerm ($termid)
 
 getParentRelationsForTerm ($termid)
 
 getAllTerms ()
 
 getParentTerms ($termid, $relid=NULL)
 
 getRelatedTerms ($relation_id='')
 
 _addTerm ($term)
 
 addTerm ($term)
 
 addTermNote ($termid, $note_name, $note_value)
 
 getTermNotes ($termid)
 
 deleteTermNotes ($termid)
 
 linkTerms ($minorid, $majorid, $relid)
 
 _linkTerms ($minorid, $majorid, $relation_id=NULL)
 
 updateTerm ($termid, $name)
 
 renameRelation ($relation_id, $new_name)
 
 getTermById ($termid)
 
 getTermLinkById ($linkid)
 
 getRelationIdByName ($name)
 
 addRelation ($name)
 
 updateLinkRelation ($linkid, $relid)
 
 getTermLinkByTermids ($termid, $parentid, $relid=NULL)
 
 getTermIdByName ($name)
 
 getTermIdsByNames ($names)
 
 isTerm ($term=NULL, $termid=0)
 
 getActiveRelations ()
 
 erase ()
 
 _deleteStoredContents ()
 
 getXmlFilePath ()
 
 _getName ($short_name=FALSE, $contextid=NULL)
 
 getAbsoluteParentsInRelation ($relation_id=NULL)
 
 getLineagesForTerm ($termid)
 
 getAsset ($shadowid, $type_code='', $mute_errors=FALSE)
 
 getAssetMapLinks ()
 
 _getShadowAssetMapLinks ($parent_term_id=NULL)
 
 _getTopTermsAssetMapLinks ()
 
 getAssetInfo ($assetids, $type_code=Array(), $strict_type_code=TRUE, $field='')
 
 getAssetMapAssetInfo ($assetid)
 
 getLinks ($assetid, $link_types, $type_code='', $strict_type_code=TRUE, $side_of_link='major', $sort_by=NULL)
 
 getLink ($assetid, $link_type=NULL, $type_code='', $strict_type_code=TRUE, $value=NULL, $side_of_link='major', $exclusive=NULL)
 
 getLinkByAsset ($assetid, $other_assetid, $link_types=NULL, $value=NULL, $side_of_link='major', $force_array=FALSE, $dependant=NULL, $exclusive=NULL)
 
 getLinkById ($linkid, $assetid=0, $side_of_link='major')
 
 _getAllowedLinks ()
 
 getChildren ($assetid, $type_code='thesaurus_term', $strict_type_code=TRUE, $dependant=TRUE, $sort_by=NULL)
 
 getParents ($assetid, $type_code='', $strict_type_code=TRUE)
 
 createAssetLink (&$major, &$minor, $link_type, $value='', $sort_order=NULL, $dependant='0', $exclusive='0', $moving=FALSE)
 
 getPermission ($assetid, $permission, $granted=NULL, $and_greater=TRUE, $expand_groups=FALSE, $all_info=FALSE)
 
 markContentsChanged ()
 
 countLinks ($assetid, $side_of_link='major', $link_types=0, $type_code='', $strict_type_code=TRUE, $ignore_linkid=0)
 
 deleteAssetLink ($linkid, $moving=FALSE)
 
 deleteTermLink ($linkid)
 
 _deleteTermLink ($linkid)
 
 deleteTerm ($termid)
 
 deleteRelation ($relid)
 
 moveLink ($linkid, $to_parentid, $link_type, $to_parent_pos)
 
 updateLink ($linkid, $link_type=NULL, $value=NULL, $new_sort_order=NULL)
 
 assetExists ($assetids)
 
 getReflections ()
 
 getReflectionForRelation ($start)
 
 addReflection ($start, $end)
 
 deleteReflection ($start)
 
 setReflections ($ref_array)
 
 canClone ()
 
 getLineageFromURL ($assetid, $protocol, $url)
 
- 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 thesaurus.inc.

Member Function Documentation

_addTerm (   $term)

Helper function to add a term to the system

NOTE: Does NOT check if the term already exists

Parameters
string$termTerm
Returns
mixed NULL|int private

Definition at line 551 of file thesaurus.inc.

_createAdditional ( $link)

Perform any additional processing required during the creation of this asset

Thesaurii create their data directory when created

Parameters
array&$linkinformation used to create the initial link
Returns
boolean private

Definition at line 83 of file thesaurus.inc.

_deleteStoredContents ( )

Deletes the contents of the database for this thesaurus

Returns
boolean private

Definition at line 1347 of file thesaurus.inc.

_deleteTermLink (   $linkid)

Delete a link between two terms

Parameters
int$linkidlink id to remove
Returns
void public

Definition at line 2285 of file thesaurus.inc.

_getAllowedLinks ( )

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

Array('[link_type]' => Array('[type_code]' => Array('card' => [cardinality], 'exclusive' => [exclusive]))); Where: link_type = SQ_LINK_TYPE_1|SQ_LINK_TYPE_2|SQ_LINK_TYPE_3|SQ_LINK_NOTICE cardinality = [max number of links]|'M' exclusive = TRUE|FALSE

Returns
array private

Definition at line 1957 of file thesaurus.inc.

_getName (   $short_name = FALSE,
  $contextid = NULL 
)

Get asset name

Parameters
boolean$short_nameReturn the short_name or name?
int$contextidWhat context to return the name from
Returns
string private
See Also
Asset::_getName()

Definition at line 1416 of file thesaurus.inc.

_getShadowAssetMapLinks (   $parent_term_id = NULL)

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

Parameters
int$parent_term_idThe ID of the parent term
Returns
array public

Definition at line 1579 of file thesaurus.inc.

_getTopTermsAssetMapLinks ( )

Get all terms for display as top level terms in the asset map

Returns
array public

Definition at line 1635 of file thesaurus.inc.

_linkTerms (   $minorid,
  $majorid,
  $relation_id = NULL 
)

Link two terms together

NOTE: This function does not check if the terms exist NOTE: Does not check if the LINK already EXISTS

Parameters
string$minoridMinor term
string$majoridMajor term, if NULL, linking to the top
string$relation_idRelation
Returns
mixed NULL|int public

Definition at line 775 of file thesaurus.inc.

addReflection (   $start,
  $end 
)

Add a reflection

Parameters
string$startid of one relation in a reflection
string$endid of another relation in a reflection
Returns
void public

Definition at line 2587 of file thesaurus.inc.

addRelation (   $name)

Get relation ID given the name

Parameters
string$namerelation name
Returns
string public

Definition at line 1050 of file thesaurus.inc.

addTerm (   $term)

Add a term to the system

Wrapper around '_addTerm' that checks if the term already exists

Parameters
string$termTerm
Returns
mixed NULL|int private

Definition at line 593 of file thesaurus.inc.

addTermNote (   $termid,
  $note_name,
  $note_value 
)

Add a term note

Parameters
string$termidTerm ID
string$note_nameNote Name
string$note_valueNote Value
Returns
array public

Definition at line 613 of file thesaurus.inc.

assetExists (   $assetids)

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

Parameters
int | array$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 2481 of file thesaurus.inc.

canClone ( )

Returns TRUE if this type of asset can be cloned

Override this function if you do not want a particular type of asset to be cloned

Returns
boolean public

Definition at line 2650 of file thesaurus.inc.

countChildTerms (   $termid)

Count child terms

Get a count of how many terms are linked directly under a given term

Parameters
int$termidTerm
Returns
array public

Definition at line 235 of file thesaurus.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) 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 2194 of file thesaurus.inc.

countParentTerms (   $termid)

Count parent terms

Get a count of how many terms are linked directly above a given term

Parameters
int$termidTerm
Returns
array public

Definition at line 315 of file thesaurus.inc.

countTermLinks ( )

Count the links in a thesaurus

Returns
array public

Definition at line 262 of file thesaurus.inc.

countTerms ( )

Count terms a thesaurus

Returns
array public

Definition at line 286 of file thesaurus.inc.

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

Create a link between the two supplied assets

returns the linkid of the created link

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
string public

Definition at line 2070 of file thesaurus.inc.

delete (   $release_lock)

Delete Asset

Parameters
boolean$release_lockTRUE, to release lock
Returns
boolean public

Definition at line 61 of file thesaurus.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 2224 of file thesaurus.inc.

deleteReflection (   $start)

Delete a reflection

Parameters
string$startid of one relation in a reflection
Returns
void public

Definition at line 2611 of file thesaurus.inc.

deleteRelation (   $relid)

Delete a link between two terms

Parameters
string$relidlink id to remove
Returns
void public

Definition at line 2371 of file thesaurus.inc.

deleteTerm (   $termid)

Delete a term

Parameters
int$termidterm id to remove
Returns
void public

Definition at line 2318 of file thesaurus.inc.

deleteTermLink (   $linkid)

Delete a link between two terms

Parameters
int$linkidlink id to remove
Returns
void public

Definition at line 2251 of file thesaurus.inc.

deleteTermNotes (   $termid)

Delete All notes for a particular term

Parameters
string$termidTerm ID
Returns
array public

Definition at line 701 of file thesaurus.inc.

erase ( )

Erases the contents of a thesaurus

Returns
boolean public

Definition at line 1326 of file thesaurus.inc.

getAbbreviations ( )

Get an array of abbrevations

the result is an array of format ("A" => "Australia") abbreviation => expansion NOTE: An expansion can have only one abbreviation

Returns
array public

Definition at line 104 of file thesaurus.inc.

getAbsoluteParentsInRelation (   $relation_id = NULL)

Get a list of Terms that only act as parents in a relation

Parameters
int$relation_idrelation Id
Returns
array public

Definition at line 1442 of file thesaurus.inc.

getActiveRelations ( )

Returns a list of all the relations in a thesaurus

Returns
array public

Definition at line 1293 of file thesaurus.inc.

getAllTerms ( )

Get a list of all terms

Returns
array public

Definition at line 414 of file thesaurus.inc.

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

Returns a reference to the asset represented by the passed assetid or NULL on error

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
object public
See Also
Asset_Manager::&getAsset()

Implements Bridge.

Definition at line 1538 of file thesaurus.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 1702 of file thesaurus.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 1743 of file thesaurus.inc.

getAssetMapLinks ( )

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

Returns
array public

Definition at line 1564 of file thesaurus.inc.

getChildRelationsForTerm (   $termid)

Get Child Relations for Term

Get the relations a given term is a parent in

Parameters
string$termidterm
Returns
array public

Definition at line 347 of file thesaurus.inc.

getChildren (   $assetid,
  $type_code = 'thesaurus_term',
  $strict_type_code = TRUE,
  $dependant = TRUE,
  $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

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 2000 of file thesaurus.inc.

getChildTerms (   $termid,
  $relid = NULL 
)

Get minor terms

Returns an array of terms which have a given term as their parent

Parameters
int$termidTerm
string$relidRelation name to limit the lookup by
Returns
array public

Definition at line 172 of file thesaurus.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 2667 of file thesaurus.inc.

getLineagesForTerm (   $termid)

Get all lineages for a term

Parameters
string$termidthe name of the term
Returns
array public

Definition at line 1509 of file thesaurus.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 1817 of file thesaurus.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 1844 of file thesaurus.inc.

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

Get details of the link with specified linkid

Parameters
int$linkidid of the desired link
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 1899 of file thesaurus.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

Implements Bridge.

Definition at line 1789 of file thesaurus.inc.

getParentRelationsForTerm (   $termid)

Get Parent Relations for Term

Get the relations a given term is a child in

Parameters
string$termidterm
Returns
array public

Definition at line 385 of file thesaurus.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

It returns Array(int => string) returns an array of assetids and their type code

Parameters
int$assetidthe id of the asset to get its parents for
string | array$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
Returns
array public

Implements Bridge.

Definition at line 2038 of file thesaurus.inc.

getParentTerms (   $termid,
  $relid = NULL 
)

Get parent terms

Return terms which are immediate parents of a given term

Parameters
int$termidTerm ID
int$relidRelation ID
Returns
array public

Definition at line 441 of file thesaurus.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 2142 of file thesaurus.inc.

getReflectionForRelation (   $start)

Get reflection relation id given the other relation

Parameters
string$startid of one relation in a reflection
Returns
string public

Definition at line 2570 of file thesaurus.inc.

getReflections ( )

Get the reflection array

Returns
void public

Definition at line 2555 of file thesaurus.inc.

getRelatedTerms (   $relation_id = '')

Given a relation, get all the Parent-Child pairs

Parameters
string$relation_idRelation to lookup
Returns
void public

Definition at line 503 of file thesaurus.inc.

getRelationIdByName (   $name)

Get relation ID given the name

Parameters
string$namerelation name
Returns
void public

Definition at line 1009 of file thesaurus.inc.

getSynonymsForTerm (   $term)

Get synonyms for a given term

Parameters
string$termTerm to find synonyms for
Returns
void public

Definition at line 134 of file thesaurus.inc.

getTermById (   $termid)

Get term by its (link) id

Gets the term that is linked as a minor by a particular link id

Parameters
int$termidlink id of the term
Returns
void public

Definition at line 945 of file thesaurus.inc.

getTermIdByName (   $name)

Returns the assetid of the thesaurus term referenced by the passed term name

Parameters
string$nameThe name of the sought term
Returns
int public

Definition at line 1157 of file thesaurus.inc.

getTermIdsByNames (   $names)

Returns the assetids of the thesaurus terms referenced by the passed term names, in the format:

Array(
  'termid'  => 'name',
)

NOTE: This does not chunk the query, may need to be modified to do so in the future

Parameters
array$namesAn array of sought terms
Returns
int public

Definition at line 1205 of file thesaurus.inc.

getTermLinkById (   $linkid)

Get term link by its id

Gets the term that is linked as a minor by a particular link id

Parameters
int$linkidlink id of the term
Returns
void public

Definition at line 978 of file thesaurus.inc.

getTermLinkByTermids (   $termid,
  $parentid,
  $relid = NULL 
)

Get link by child and parent term ids

Parameters
string$termidthe id of the child in this link
string$parentidthe id of the parent in this link
string$relidthe relation of the link
Returns
void public

Definition at line 1123 of file thesaurus.inc.

getTermNotes (   $termid)

Get All Term Notes

Parameters
string$termidTerm ID
Returns
array public

Definition at line 672 of file thesaurus.inc.

getXmlFilePath ( )

Get the path to the imported xml file

Returns
string public

Definition at line 1399 of file thesaurus.inc.

isTerm (   $term = NULL,
  $termid = 0 
)

Check whether supplied string is a term in this thesaurus

Parameters
string$termterm name
int$termidterm id
Returns
boolean public

Definition at line 1241 of file thesaurus.inc.

linkTerms (   $minorid,
  $majorid,
  $relid 
)

Link two terms in the system

Wrapper around '_linkTerms' that checks if this link already exists

Parameters
string$minoridminor term id
string$majoridmajor term id
string$relidrelation id
Returns
mixed NULL|int private

Definition at line 741 of file thesaurus.inc.

markContentsChanged ( )

Mark thesaurus as having its contents changed

This function should be called when any change to thesaurus is performed XML output functionality depends on this

Returns
void public

Definition at line 2159 of file thesaurus.inc.

moveLink (   $linkid,
  $to_parentid,
  $link_type,
  $to_parent_pos 
)

Move a link to a new parent

Parameters
int$linkidthe link id of the link to move
int$to_parentidthe asset id of the new parent asset
int$link_typethe type of the new link
int$to_parent_posthe position under the new parent
Returns
int public

Definition at line 2440 of file thesaurus.inc.

renameRelation (   $relation_id,
  $new_name 
)

Renames all instances of $relation to $new_relation

Returns TRUE on success, FALSE on failure

Parameters
string$relation_idrelation to rename
string$new_namethe desired new relation
Returns
boolean public

Definition at line 894 of file thesaurus.inc.

setReflections (   $ref_array)

Set an array of reflections

Parameters
array$ref_arrayarray of reflections in format 'a'=>'b', 'b'=>'a'
Returns
void public

Definition at line 2634 of file thesaurus.inc.

Thesaurus (   $assetid = 0)

Constructor

Parameters
int$assetidthe asset id to be loaded

Definition at line 45 of file thesaurus.inc.

updateLink (   $linkid,
  $link_type = NULL,
  $value = NULL,
  $new_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$new_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 2460 of file thesaurus.inc.

updateLinkRelation (   $linkid,
  $relid 
)

Update link with a new relation id

Parameters
string$linkidrelation name
string$relidrelation name
Returns
void public

Definition at line 1093 of file thesaurus.inc.

updateTerm (   $termid,
  $name 
)

Update term name and relation

Returns TRUE on success, FALSE on failure

Parameters
int$termidlink id to update
string$namethe name of term
Returns
boolean public

Definition at line 835 of file thesaurus.inc.


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