Joomla CMS  3.8.5 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.8.5 et du framework Joomla Platform intégré
Référence de la classe TagsHelper
+ Graphe d'héritage de TagsHelper:

Fonctions membres publiques

 addTagMapping ($ucmId, TableInterface $table, $tags=array())
 
 createTagsFromField ($tags)
 
 createTagsFromMetadata ($metadata)
 
 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())
 
 getTypeId ($typeAlias)
 
 postStoreProcess (TableInterface $table, $newTags=array(), $replace=true)
 
 preStoreProcess (TableInterface $table, $newTags=array())
 
 tagDeleteInstances ($tag_id)
 
 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 = null
 

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(), et TableInterface\getKeyName().

◆ 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, et $query.

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, Table\addIncludePath(), Table\getInstance(), et JPATH_ADMINISTRATOR.

◆ createTagsFromMetadata()

createTagsFromMetadata (   $metadata)

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

Paramètres
string$metadataMetadata JSON string
Renvoie
mixed If successful, metadata with new tag titles replaced by tag ids. Otherwise false.
Depuis
3.1
Obsolète:
4.0 This method is no longer used in the CMS and will not be replaced.

Références Table\addIncludePath(), Table\getInstance(), JPATH_ADMINISTRATOR, et json_encode.

◆ 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, et ComponentHelper\getParams().

◆ 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, 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, $language, $query, $type, $user, 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, 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, Table\addIncludePath(), Table\getInstance(), et JPATH_ADMINISTRATOR.

◆ getTypeId()

getTypeId (   $typeAlias)

Method to get the type id for a type alias.

Paramètres
string$typeAliasA type alias.
Renvoie
string Name of the table for a type
Depuis
3.1
Obsolète:
4.0 Use ::getTypeId() instead

◆ 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 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, et ArrayHelper\toInteger().

◆ 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 exising tags should be replaced
Renvoie
boolean
Depuis
3.1

Références $data, $key, 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, $query, $results, Table\addIncludePath(), Table\getInstance(), et JPATH_ADMINISTRATOR.

◆ tagDeleteInstances()

tagDeleteInstances (   $tag_id)

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

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

Références $db, et $query.

◆ 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 exising tags should be replaced
Renvoie
boolean true on success, otherwise false.
Depuis
3.1

Références $key.

◆ 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, TableInterface\getKeyName(), et ArrayHelper\toInteger().

Documentation des champs

◆ $replaceTags

$replaceTags = false
protected

◆ $tagsChanged

$tagsChanged = false
protected

◆ $typeAlias

$typeAlias = null

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