Class TfTagHandler
Manipulates tag content objects (TfTag).
-
TfContentHandler
uses
TfContentTypes
-
TfTagHandler
Package: content
Copyright:
Simon Wilkinson 2013+ (https://tuskfish.biz)
License:
GNU General Public License (GPL) V2
Author:
Simon Wilkinson
simon@isengard.biz
Version:
Release: 1.0
Since:
1.0
Uses:
TfContentTypes
Whitelist of sanctioned TfishContentObject subclasses.
Var:
TfValidator $validator Instance of the Tuskfish data validator class.
Var:
TfDatabase $db Instance of the Tuskfish database class.
Var:
TfCriteriaFactory $criteriaFactory Instance of the Tuskfish criteria factory class.
Var:
TfFileHandler $fileHandler Instance of the Tuskfish file handler class.
Var:
TfTaglinkHandler $taglinkHandler Instance of the Tuskfish taglink handler class.
Located at trust_path/modules/content/class/TfTagHandler.php
Methods summary
public
|
#
__construct( TfValidator $validator, TfDatabase $db, TfCriteriaFactory $criteriaFactory, TfFileHandler $fileHandler, TfTaglinkHandler $taglinkHandler )
Constructor.
Parameters
- $validator
- An instance of the Tuskfish data validator class.
- $db
- An instance of the database class.
- $criteriaFactory
- an instance of the Tuskfish criteria factory class.
- $fileHandler
- An instance of the Tuskfish file handler class.
- $taglinkHandler
- An instance of the Tuskfish taglink handler class.
Overrides
|
public
string
|
#
getArbitraryTagSelectBox( integer $selected = null, array $tagList = array(), string $keyName = null, string $zeroOption = TFISH_SELECT_TAGS )
Build a select box from an arbitrary array of tags.
Build a select box from an arbitrary array of tags.
Use this when you need to customise a tag select box. Pass in an array of the tags you want
to use as $tagList as key => value pairs. If you have multiple select boxes on one page then
you need to assign them different keys and listen for matching input parameters. If you have
organised tags into collections, you can run a query to retrieve that subset using the
parental ID as a selection criteria.
Parameters
- $selected
- ID of selected option.
- $tagList
- Array of options in tagId => title format.
- $keyName
The input parameter name you want to use as key for this select box.
Defaults to 'tagId'.
- $zeroOption
The string that will be displayed for the 'zero' or no selection
option.
Returns
string HTML select box.
|
public
integer
|
#
getCount( TfCriteria $criteria = null )
Count TfTag objects, optionally matching conditions specified with a TfCriteria object.
Count TfTag objects, optionally matching conditions specified with a TfCriteria object.
Parameters
- $criteria
- Query composer object used to build conditional database query.
Returns
integer $count Number of TfTagObjects that match the criteria.
Overrides
|
public
array
|
#
getObjects( TfCriteria $criteria = null )
Get TfTag objects, optionally matching conditions specified with a TfCriteria object.
Get TfTag objects, optionally matching conditions specified with a TfCriteria object.
Note that the object type is automatically set, so it is unnecessary to set it when calling
TfTagHandler::getObjects($criteria). However, if you want to use the generic handler
TfContentHandler::getObjects($criteria) then you do need to specify the object type,
otherwise you will get all types of content returned. It is acceptable to use either handler,
although good practice to use the type-specific one when you know you want a specific kind of
object.
Parameters
- $criteria
- Query composer object used to build conditional database query.
Returns
array $objects Array of TfTag objects.
Overrides
|
public
boolean|string
|
#
getTagSelectBox( integer $selected = null, string $module = '', string $type = '', string $zeroOption = TFISH_SELECT_TAGS, boolean $onlineOnly = true )
Generates a tag select box control for the content module.
Generates a tag select box control for the content module.
Use the $onlineOnly parameter to control whether you retrieve all tags, or just those marked
as online. Essentially this provides a way to keep your select box uncluttered; mark tags
that are not important enough to serve as navigation elements as 'offline'. They are still
available, but they won't appear in the select box list.
Parameters
- $selected
- ID of selected option.
- $module
- $type Type of content object, eg. TfArticle.
- $type
$zeroOption The string that will be displayed for the 'zero' or no selection
option.
- $zeroOption
- $onlineOnly Get all tags or just those marked online.
- $onlineOnly
Returns
boolean|string False if no tags or a HTML select box if there are.
|
convertRowToObject()
,
delete()
,
deleteParentalReferences()
,
getActiveTagList()
,
getListOfMimetypes()
,
getListOfTitles()
,
getObject()
,
getOnlineSelectBox()
,
getTagList()
,
getTags()
,
getTypeIndex()
,
getTypeSelectBox()
,
insert()
,
isSanctionedType()
,
loadTagsForObject()
,
makeTagLinks()
,
streamDownloadToBrowser()
,
toggleOnlineStatus()
,
update()
,
updateCounter()