Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe TagsHelper
+ Graphe d'héritage de TagsHelper:

Fonctions membres publiques

 addTagMapping ($ucmId, TableInterface $table, $tags=array())
 
 createTagsFromField ($tags)
 
 getItemTags ($contentType, $id, $getTagData=true)
 
 getTagIds ($ids, $prefix)
 
 getTagItemsQuery ( $tagId, $typesr=null, $includeChildren=false, $orderByOption='c.core_title', $orderDir='ASC', $anyOrAll=true, $languageFilter='all', $stateFilter='0, 1')
 
 getTagNames ($tagIds)
 
 getTagTreeArray ($id, &$tagTreeArray=array())
 
 postStoreProcess (TableInterface $table, $newTags=array(), $replace=true)
 
 preStoreProcess (TableInterface $table, $newTags=array())
 
 tagDeleteInstances ($tagId)
 
 tagItem ($ucmId, TableInterface $table, $tags=array(), $replace=true)
 
 unTagItem ($contentId, TableInterface $table, $tags=array())
 
- Fonctions membres publiques hérités de CMSHelper
 getCurrentLanguage ($detectBrowser=true)
 
 getLanguageId ($langCode)
 
 getRowData (TableInterface $table)
 
 getDataObject (TableInterface $table)
 

Fonctions membres publiques statiques

static convertPathsToNames ($tags)
 
static getTypes ($arrayType='objectList', $selectTypes=null, $useAlias=true)
 
static searchTags ($filters=array())
 

Champs de données

 $typeAlias
 
 $itemTags
 

Attributs protégés

 $tagsChanged = false
 
 $replaceTags = false
 

Description détaillée

Tags helper class, provides methods to perform various tasks relevant tagging of content.

Depuis
3.1

Documentation des fonctions membres

◆ addTagMapping()

addTagMapping (   $ucmId,
TableInterface  $table,
  $tags = array() 
)

Method to add tag rows to mapping table.

Paramètres
integer$ucmIdID of the #__ucm_content item being tagged
TableInterface$tableTable object being tagged
array$tagsArray of tags to be applied.
Renvoie
boolean true on success, otherwise false.
Depuis
3.1

Références $db, $item, $key, $query, TableInterface\getDbo(), TableInterface\getKeyName(), et ParameterType\STRING.

◆ convertPathsToNames()

static convertPathsToNames (   $tags)
static

Function that converts tags paths into paths of names

Paramètres
array$tagsArray of tags
Renvoie
array
Depuis
3.1

Références $db, $query, Factory\getDbo(), et ParameterType\STRING.

Référencé par TagField\getOptions().

◆ createTagsFromField()

createTagsFromField (   $tags)

Create any new tags by looking for #new# in the strings

Paramètres
array$tagsTags text array from the field
Renvoie
mixed If successful, metadata with new tag titles replaced by tag ids. Otherwise false.
Depuis
3.1

Références $canCreate, $key, $result, Factory\getApplication(), et Factory\getUser().

◆ getItemTags()

getItemTags (   $contentType,
  $id,
  $getTagData = true 
)

Method to get a list of tags for an item, optionally with the tag data.

Paramètres
string$contentTypeContent type alias. Dot separated.
integer$idId of the item to retrieve tags for.
boolean$getTagDataIf true, data from the tags table will be included, defaults to true.
Renvoie
array Array of of tag objects
Depuis
3.1

Références $db, $groups, $id, $language, $query, $user, Factory\getDbo(), ComponentHelper\getParams(), Factory\getUser(), ParameterType\INTEGER, et ParameterType\STRING.

◆ getTagIds()

getTagIds (   $ids,
  $prefix 
)

Method to get a list of tags for a given item. Normally used for displaying a list of tags within a layout

Paramètres
mixed$idsThe id or array of ids (primary key) of the item to be tagged.
string$prefixDot separated string with the option and view to be used for a url.
Renvoie
string Comma separated list of tag Ids.
Depuis
3.1

Ids possible formats:

$id = 1; $id = array(1,2); $id = array('1,3,4,19'); $id = '1,3';

Références $db, $prefix, $query, Factory\getDbo(), et ArrayHelper\toInteger().

◆ getTagItemsQuery()

getTagItemsQuery (   $tagId,
  $typesr = null,
  $includeChildren = false,
  $orderByOption = 'c.core_title',
  $orderDir = 'ASC',
  $anyOrAll = true,
  $languageFilter = 'all',
  $stateFilter = '0,
1'   
)

Method to get a query to retrieve a detailed list of items for a tag.

Paramètres
mixed$tagIdTag or array of tags to be matched
mixed$typesrNull, type or array of type aliases for content types to be included in the results
boolean$includeChildrenTrue to include the results from child tags
string$orderByOptionColumn to order the results by
string$orderDirDirection to sort the results in
boolean$anyOrAllTrue to include items matching at least one tag, false to include items all tags in the array.
string$languageFilterOptional filter on language. Options are 'all', 'current' or any string.
string$stateFilterOptional filtering on publication state, defaults to published or unpublished.
Renvoie
Query to retrieve a list of tags
Depuis
3.1

Références $db, $groups, $nowDate, $query, $user, Factory\getDate(), Factory\getDbo(), Factory\getUser(), ParameterType\INTEGER, ParameterType\STRING, et ArrayHelper\toInteger().

◆ getTagNames()

getTagNames (   $tagIds)

Function that converts tag ids to their tag names

Paramètres
array$tagIdsArray of integer tag ids.
Renvoie
array An array of tag names.
Depuis
3.1

Références $db, $query, Factory\getDbo(), et ArrayHelper\toInteger().

◆ getTagTreeArray()

getTagTreeArray (   $id,
$tagTreeArray = array() 
)

Method to get an array of tag ids for the current tag and its children

Paramètres
integer$idAn optional ID
array&$tagTreeArrayArray containing the tag tree
Renvoie
mixed
Depuis
3.1

Références $id, et Factory\getApplication().

◆ getTypes()

static getTypes (   $arrayType = 'objectList',
  $selectTypes = null,
  $useAlias = true 
)
static

Method to get a list of types with associated data.

Paramètres
string$arrayTypeOptionally specify that the returned list consist of objects, associative arrays, or arrays. Options are: rowList, assocList, and objectList
array$selectTypesOptional array of type ids or aliases to limit the results to. Often from a request.
boolean$useAliasIf true, the alias is used to match, if false the type_id is used.
Renvoie
array Array of of types
Depuis
3.1

Références $db, $query, Factory\getDbo(), ParameterType\STRING, et ArrayHelper\toInteger().

Référencé par HtmlView\display().

◆ postStoreProcess()

postStoreProcess ( TableInterface  $table,
  $newTags = array(),
  $replace = true 
)

Function that handles saving tags used in a table class after a store()

Paramètres
TableInterface$tableTable being processed
array$newTagsArray of new tags
boolean$replaceFlag indicating if all existing tags should be replaced
Renvoie
boolean
Depuis
3.1

Références $data, $key, $result, Table\getInstance(), et TableInterface\reset().

◆ preStoreProcess()

preStoreProcess ( TableInterface  $table,
  $newTags = array() 
)

Function that preProcesses data from a table prior to a store() to ensure proper tag handling

Paramètres
TableInterface$tableTable being processed
array$newTagsArray of new tags
Renvoie
null
Depuis
3.1

Références $key, et TableInterface\reset().

◆ searchTags()

static searchTags (   $filters = array())
static

Function to search tags

Paramètres
array$filtersFilter to apply to the search
Renvoie
array
Depuis
3.1

Références $db, $filters, $groups, $published, $query, $results, Factory\getApplication(), Factory\getDbo(), ParameterType\INTEGER, ParameterType\STRING, et ArrayHelper\toInteger().

Référencé par TagsController\searchAjax().

◆ tagDeleteInstances()

tagDeleteInstances (   $tagId)

Method to delete all instances of a tag from the mapping table. Generally used when a tag is deleted.

Paramètres
integer$tagIdThe tag_id (primary key) for the deleted tag.
Renvoie
void
Depuis
3.1

Références $db, $query, Factory\getDbo(), et ParameterType\INTEGER.

◆ tagItem()

tagItem (   $ucmId,
TableInterface  $table,
  $tags = array(),
  $replace = true 
)

Method to add or update tags associated with an item.

Paramètres
integer$ucmIdId of the #__ucm_content item being tagged
TableInterface$tableTable object being tagged
array$tagsArray of tags to be applied.
boolean$replaceFlag indicating if all existing tags should be replaced
Renvoie
boolean true on success, otherwise false.
Depuis
3.1

Références $key, $result, et $this.

◆ unTagItem()

unTagItem (   $contentId,
TableInterface  $table,
  $tags = array() 
)

Method to untag an item

Paramètres
integer$contentIdID of the content item being untagged
TableInterface$tableTable object being untagged
array$tagsArray of tags to be untagged. Use an empty array to untag all existing tags.
Renvoie
boolean true on success, otherwise false.
Depuis
3.1

Références $db, $id, $key, $query, Factory\getDbo(), TableInterface\getKeyName(), ParameterType\INTEGER, et ArrayHelper\toInteger().

Documentation des champs

◆ $itemTags

$itemTags

◆ $replaceTags

$replaceTags = false
protected

◆ $tagsChanged

$tagsChanged = false
protected

◆ $typeAlias

$typeAlias

La documentation de cette classe a été générée à partir du fichier suivant :