Méthode pour récupérer la liste des tags.

@return  array
546740
protected function getOptions() {

        $published = $this->element['published'] ? (string)$this->element['published'] : array(0, 1);
        $table = $this->element['table'] ? (string)$this->element['table'] : false;

        $db    = $this->form->getDb();
        $query = $db->getQuery(true)
                    ->select('DISTINCT a.id AS value, a.path, a.title AS text, a.level')
                    ->from('#__tags AS a')
                    ->join('LEFT', '#__tags AS b ON a.lft > b.lft AND a.rgt < b.rgt');

        $query->where('a.lft > 0');
        // Filtre par état de publication
        if (is_numeric($published)) {
            $query->where('a.published = ' . (int)$published);
        } elseif (is_array($published)) {
            ArrayHelper::toInteger($published);
            $query->where('a.published IN (' . implode(',', $published) . ')');
        }

        // Filtre par association.
        if ($table) {
            $query->leftJoin('#__tags_map AS c ON c.tag_id = a.id');
            $query->where('c.table_name = ' . $db->quote($table));
        }

        $query->order('a.lft ASC');
        $db->setQuery($query);

        try {
            $options = $db->loadObjectList();
        } catch (\RuntimeException $e) {
            return false;
        }

        // On bloque la possibilité de définir un tag comme son propre parent.
        if ($this->form->getName() == 'tag') {
            $id = (int)$this->form->getValue('id', 0);

            foreach ($options as $option) {
                if ($option->value == $id) {
                    $option->disable = true;
                }
            }
        }

        // On fusionne les options additionnelles venant du XML.
        $options = array_merge(parent::getOptions(), $options);

        // On prépare les options imbriquées.
        if ($this->isNested()) {
            $this->prepareOptionsNested($options);
        } else {
            $options = $this->convertPathsToNames($options);
        }

        return $options;
    }
619880
public function getTags(): array
    {
        $tsfe = $this->getTsfe();
        if (!($tsfe instanceof TypoScriptFrontendController)) {
            return [];
        }

        return \array_unique((array)ObjectAccess::getProperty($tsfe, 'pageCacheTags', true));
    }
1117612
protected function pullTagsFromProducts() : array
	{
		return $this->products->map(function ($item) {
			return explode(',', str_replace('"', '', $item->tags));
		})->flatten()->unique()->all();
	}
51080
public function getPopularTags()
    {
        $question = $this->findAll();

        $tagsMultiArray = array_map(function ($question) {
            return explode(',', $question->tags);
        }, $question);

        // Merge multi array, count values, sort high to low
        $tagArr = array_count_values(call_user_func_array("array_merge", $tagsMultiArray));
        arsort($tagArr);
        return $tagArr;
    }
1135552
protected function getTagsFromSphinx()
    {
        if (is_array($this->searchResults) && count($this->searchResults)) {
            return array_map(
                function ($row) {
                    return $row['tags'];
                },
                $this->searchResults
            );
        } else {
            return array();
        }
    }
408151
public function getCurrentTags()
    {
        if (!isset($this->_currentTags)) {
            if (!$this->viaClass) {
                return [];
            }
            $viaClass = $this->viaClass;
            $params = [$this->viaLocalField => $this->owner->primaryKey];
            $rawTags = $viaClass::find()->disableAccessCheck()->where($params)->select($this->viaForeignField)->column();

            $this->_currentTags = [];
            foreach ($rawTags as $tag) {
                $this->_currentTags[$tag] = $tag;
            }
        }

        return $this->_currentTags;
    }
697405
public function getTagsFromSearchResult()
    {
        $tags = $tagsForResult = array();
        $tagChar = $this->pObj->extConf['prePostTagChar'];
        $tagDivider = $tagChar . ',' . $tagChar;

        if ($this->sphinxSearchEnabled()) {
            $tagsForResult = $this->getTagsFromSphinx();
        } else {
            $tagsForResult = $this->getTagsFromMySQL();
        }
        foreach ($tagsForResult as $tagSet) {
            $tagSet = explode($tagDivider, trim($tagSet, $tagChar));
            foreach ($tagSet as $tag) {
                $tags[$tag] += 1;
            }
        }
        return $tags;
    }
1304457
public static function getTags()
    {
        $finder = new Tag\Finder\Finder();

        foreach (func_get_args() as $arg) {
            if (is_string($arg)) {
                $finder->addFilter(new Tag\Finder\Group($arg));
            } elseif ($arg instanceof PageInterface) {
                $finder->addFilter(new Tag\Finder\AppliedToPage($arg));
            } elseif ($arg instanceof TagInterface) {
                $finder->addFilter(new Tag\Finder\AppliedWith($arg));
            }
        }

        return $finder
            ->setOrderBy('group', 'asc')
            ->setOrderBy('name', 'asc')
            ->findAll();
    }
49352
protected function load_standard_tags() {
        global $CFG, $DB;
        if (!$this->is_tagging_enabled()) {
            return array();
        }
        $namefield = empty($CFG->keeptagnamecase) ? 'name' : 'rawname';
        $tags = $DB->get_records_menu('tag',
            array('isstandard' => 1, 'tagcollid' => $this->get_tag_collection()),
            $namefield, 'id,' . $namefield);
        return array_combine($tags, $tags);
    }
47626
public function getTagsList()
    {
        $return = "";
        $tags = $this->Tags()->column("Title");
        
        $this->extend("updateTagsList", $tags);
        
        return implode(
            $this->config()->list_seperator,
            $tags
        );
    }
134227
private function getAllTags(): array
    {
        if ($this->tags === null) {
            $this->tags = $this->loadAllTags();
        }

        return $this->tags;
    }
974597
public function index()
    {
        $entries = WinkTag::when(request()->has('search'), function ($q) {
            $q->where('name', 'LIKE', '%'.request('search').'%');
        })
            ->orderBy('created_at', 'DESC')
            ->withCount('posts')
            ->get();

        return TagsResource::collection($entries);
    }
579985
def tag_list(self):
        """"""
        tags = [tag.strip() for tag in self.tag_string.split(",")]
        return sorted(filter(None, tags))
821171
public function getTagFilters()
    {
        if ($this->tagFilters === ['none']) {
            $result = null;
        } elseif ($this->tagFilters === ['all']) {
            $result = [];
        } else {
            $result = $this->tagFilters;
        }

        return $result;
    }
632783
protected function filterTags()
    {
        $data       = array();
        $returndata = array();
        $predicates = array();
        $count      = 0;
        $arr        = $this->getData();
        if (!empty($this->templateVars['Page']) && !empty($this->templateVars['MaxRows'])) {
            $this->templateVars['StartItem'] = (($this->templateVars['Page']-1)*$this->templateVars['MaxRows']) +1;
            $this->templateVars['EndItem'] = ($this->templateVars['Page'])*$this->templateVars['MaxRows'];
        }

        $partial = $this->getTemplateVariable('Partial');

        $partials = array();
        if(!empty($partial)) {
            $partialsStr = explode(',',$partial);
            foreach($partialsStr as $partial)
                $partials[] = new TagPartial($partial);
        }

        if (!empty($arr))
            foreach ((array)$arr as $tag) {
                if (!empty($partials)) {
                    $found = false;
                    foreach($partials as $partial) {
                        if($this->TagsHelper->matchPartial($partial, $tag))
                        {
                            $found = true;
                            break;
                        }
                    }
                    if(!$found)
                        continue;
                }

                if (($this->getTemplateVariable('Status.eq') != null) &&
                  $tag['TagLinkStatus'] != $this->getTemplateVariable('Status.eq'))
                    continue;
                if (($this->getTemplateVariable('Status.isActive') != null) && empty($tag['TagLinkURL']))
                    continue;

                $data[] = $tag;
            }

        $this->templateVars['TotalRecords'] = sizeof($data);
        if (!empty($data))
            foreach ((array)$data as $row) {
                if (!empty($this->templateVars['StartItem']) && $this->templateVars['StartItem'] > ++$count)
                    continue;

                $returndata[] = $row['TagLinkNode'];

                if (!empty($this->templateVars['MaxRows']) && sizeof($returndata) >= $this->templateVars['MaxRows'])
                    break;
            }
        return $returndata;
    }
544357
private function getAllTags()
    {
        if ($comment = $this->getDocComment()) {
            if (preg_match_all("/\@(\w+)(.*)/", $comment, $m)) {
                foreach ($m[0] as $i => $result) {
                    $tagName = $m[1][$i];
                    $tagValue = trim($m[2][$i]);
                    $this->setTag($tagName, $tagValue);
                }
            }
        }
    }
642110
public function getTags()
    {
        $value = $this->getData('tags');
        /** @noinspection IsEmptyFunctionUsageInspection */
        if (!empty($decoded = json_decode($value, true))) {
            return $decoded;
        }
        return [];
    }