Class TfishTagHandler
Handler class for tag content objects.
-
TfishContentHandler
-
TfishTagHandler
Methods summary
public static
integer
|
#
getCount( TfishCriteria $criteria = null )
Count TfishTag objects, optionally matching conditions specified with a TfishCriteria object.
Count TfishTag objects, optionally matching conditions specified with a TfishCriteria object.
Parameters
- $criteria
- TfishCriteria object used to build conditional database query.
Returns
integer $count Number of TfishTagObjects that match the criteria.
Overrides
|
public static
array
|
#
getObjects( TfishCriteria $criteria = null )
Get TfishTag objects, optionally matching conditions specified with a TfishCriteria object.
Get TfishTag objects, optionally matching conditions specified with a TfishCriteria object.
Note that the object type is automatically set, so it is unnecessary to set it when calling
TfishTagHandler::getObjects($criteria). However, if you want to use the generic handler
TfishContentHandler::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
- TfishCriteria object used to build conditional database query.
Returns
array $objects Array of TfishTag objects.
Overrides
|
public static
boolean|string
|
#
getTagSelectBox( integer $selected = null, string $type = '', string $zero_option = TFISH_SELECT_TAGS, boolean $online_only = true )
Generates a tag select box control.
Generates a tag select box control.
Use the $online_only 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.
- $type
- Type of content object, eg. TfishArticle.
- $zero_option
The string that will be displayed for the 'zero' or no selection
option.
- $online_only
- Get all tags or just those marked online.
Returns
boolean|string False if no tags or a HTML select box if there are.
|
public static
string
|
#
getArbitraryTagSelectBox( integer $selected = null, array $tag_list = array(), string $key_name = null, string $zero_option = 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 $tag_list 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.
- $tag_list
- Array of options in tag_id => title format.
- $key_name
The input parameter name you want to use as key for this select box.
Defaults to 'tag_id'.
- $zero_option
The string that will be displayed for the 'zero' or no selection
option.
Returns
string HTML select box.
|
delete()
,
deleteParentalReferences()
,
getActiveTagList()
,
getLanguages()
,
getList()
,
getObject()
,
getOnlineSelectBox()
,
getRights()
,
getTagList()
,
getTags()
,
getTypeIndex()
,
getTypeSelectBox()
,
getTypes()
,
insert()
,
isSanctionedType()
,
makeTagLinks()
,
searchContent()
,
toObject()
,
toggleOnlineStatus()
,
update()
,
updateCounter()