Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
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 | |
Tags helper class, provides methods to perform various tasks relevant tagging of content.
addTagMapping | ( | $ucmId, | |
TableInterface | $table, | ||
$tags = array() |
|||
) |
Method to add tag rows to mapping table.
integer | $ucmId | ID of the #__ucm_content item being tagged |
TableInterface | $table | Table object being tagged |
array | $tags | Array of tags to be applied. |
Références $db, $item, $key, $query, TableInterface\getDbo(), TableInterface\getKeyName(), et ParameterType\STRING.
|
static |
Function that converts tags paths into paths of names
array | $tags | Array of tags |
Références $db, $query, Factory\getDbo(), et ParameterType\STRING.
Référencé par TagField\getOptions().
createTagsFromField | ( | $tags | ) |
Create any new tags by looking for #new# in the strings
array | $tags | Tags text array from the field |
Références $canCreate, $key, $result, Factory\getApplication(), et Factory\getUser().
getItemTags | ( | $contentType, | |
$id, | |||
$getTagData = true |
|||
) |
Method to get a list of tags for an item, optionally with the tag data.
string | $contentType | Content type alias. Dot separated. |
integer | $id | Id of the item to retrieve tags for. |
boolean | $getTagData | If true, data from the tags table will be included, defaults to true. |
Références $db, $groups, $id, $language, $query, $user, Factory\getDbo(), ComponentHelper\getParams(), Factory\getUser(), ParameterType\INTEGER, et ParameterType\STRING.
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
mixed | $ids | The id or array of ids (primary key) of the item to be tagged. |
string | $prefix | Dot separated string with the option and view to be used for a url. |
$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 | ( | $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.
mixed | $tagId | Tag or array of tags to be matched |
mixed | $typesr | Null, type or array of type aliases for content types to be included in the results |
boolean | $includeChildren | True to include the results from child tags |
string | $orderByOption | Column to order the results by |
string | $orderDir | Direction to sort the results in |
boolean | $anyOrAll | True to include items matching at least one tag, false to include items all tags in the array. |
string | $languageFilter | Optional filter on language. Options are 'all', 'current' or any string. |
string | $stateFilter | Optional filtering on publication state, defaults to published or unpublished. |
Références $db, $groups, $nowDate, $query, $user, Factory\getDate(), Factory\getDbo(), Factory\getUser(), ParameterType\INTEGER, ParameterType\STRING, et ArrayHelper\toInteger().
getTagNames | ( | $tagIds | ) |
Function that converts tag ids to their tag names
array | $tagIds | Array of integer tag ids. |
Références $db, $query, Factory\getDbo(), et ArrayHelper\toInteger().
getTagTreeArray | ( | $id, | |
& | $tagTreeArray = array() |
||
) |
Method to get an array of tag ids for the current tag and its children
integer | $id | An optional ID |
array | &$tagTreeArray | Array containing the tag tree |
Références $id, et Factory\getApplication().
Method to get a list of types with associated data.
string | $arrayType | Optionally specify that the returned list consist of objects, associative arrays, or arrays. Options are: rowList, assocList, and objectList |
array | $selectTypes | Optional array of type ids or aliases to limit the results to. Often from a request. |
boolean | $useAlias | If true, the alias is used to match, if false the type_id is used. |
Références $db, $query, Factory\getDbo(), ParameterType\STRING, et ArrayHelper\toInteger().
Référencé par HtmlView\display().
postStoreProcess | ( | TableInterface | $table, |
$newTags = array() , |
|||
$replace = true |
|||
) |
Function that handles saving tags used in a table class after a store()
TableInterface | $table | Table being processed |
array | $newTags | Array of new tags |
boolean | $replace | Flag indicating if all existing tags should be replaced |
Références $data, $key, $result, Table\getInstance(), et TableInterface\reset().
preStoreProcess | ( | TableInterface | $table, |
$newTags = array() |
|||
) |
Function that preProcesses data from a table prior to a store() to ensure proper tag handling
TableInterface | $table | Table being processed |
array | $newTags | Array of new tags |
Références $key, et TableInterface\reset().
|
static |
Function to search tags
array | $filters | Filter to apply to the search |
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 | ( | $tagId | ) |
Method to delete all instances of a tag from the mapping table. Generally used when a tag is deleted.
integer | $tagId | The tag_id (primary key) for the deleted tag. |
Références $db, $query, Factory\getDbo(), et ParameterType\INTEGER.
tagItem | ( | $ucmId, | |
TableInterface | $table, | ||
$tags = array() , |
|||
$replace = true |
|||
) |
Method to add or update tags associated with an item.
integer | $ucmId | Id of the #__ucm_content item being tagged |
TableInterface | $table | Table object being tagged |
array | $tags | Array of tags to be applied. |
boolean | $replace | Flag indicating if all existing tags should be replaced |
unTagItem | ( | $contentId, | |
TableInterface | $table, | ||
$tags = array() |
|||
) |
Method to untag an item
integer | $contentId | ID of the content item being untagged |
TableInterface | $table | Table object being untagged |
array | $tags | Array of tags to be untagged. Use an empty array to untag all existing tags. |
Références $db, $id, $key, $query, Factory\getDbo(), TableInterface\getKeyName(), ParameterType\INTEGER, et ArrayHelper\toInteger().
$itemTags |
|
protected |
|
protected |
$typeAlias |