Returns all tag areas in the given tag collection

@param int $tagcollid
@return array
505425
public static function get_areas($tagcollid) {
        $allitemtypes = core_tag_area::get_areas($tagcollid, true);
        $itemtypes = array();
        foreach ($allitemtypes as $itemtype => $it) {
            foreach ($it as $component => $v) {
                $itemtypes[$v->id] = $v;
            }
        }
        return $itemtypes;
    }
375149
static public function fetchByTagID( $tagID )
    {
        $tagKeywordList = parent::fetchObjectList( self::definition(), null, array( 'keyword_id' => $tagID ) );

        if ( is_array( $tagKeywordList ) )
            return $tagKeywordList;

        return array();
    }
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;
    }
1346961
public static function get_tag_collections() {
        global $CFG, $PAGE;

        if (empty($CFG->usetags)) {
            throw new moodle_exception('tagsaredisabled', 'tag');
        }

        $context = context_system::instance();
        self::validate_context($context);
        $PAGE->set_context($context); // Needed by internal APIs.
        $output = $PAGE->get_renderer('core');

        $collections = core_tag_collection::get_collections();
        $exportedcollections = array();
        foreach ($collections as $collection) {
            $exporter = new \core_tag\external\tag_collection_exporter($collection);
            $exportedcollections[] = $exporter->export($output);
        }

        return array(
            'collections' => $exportedcollections,
            'warnings' => array(),
        );
    }
200538
public function getPostsByTags($limit = 6, $tagIDs = [])
    {
        $tags = "tags";
        // Validate post type
        if(!$tagIDs) {
            $tagIDs = [];
            foreach ($this->$tags as $tag) {
                $tagIDs[] = $tag->tagID;
            }
        }

        if($tagIDs) {
            $postsObj = new Post();
            $postsObj->setTable($this->getTable());
            $posts = $postsObj
                ->select('postID', 'title', 'featuredImageID', 'slug')
                ->join($this->getTable().'_tags', $this->getTable().'_tags.postID', $this->getTable() . '.postID')
                ->with('featuredImage')
                ->published()
                ->whereIn('tagID', $tagIDs)
                ->where('postID', "!=", $this->postID)
                ->orderBy('published_at', 'DESC')
                ->limit($limit)
                ->get();

            return $posts;
        }else{
            return collect();
        }
    }
95298
public function getFieldListByTag($tag)
    {
        $matchingFieldList = array();
        foreach ($this->fieldList as $field) {
            if ($field->hasTag($tag)) {
                $matchingFieldList[]  = $field;
            }
        }
        return $matchingFieldList;
    }
934778
def getAllNodes(self):
        '''
            
        '''

        ret = TagCollection()

        for rootNode in self.getRootNodes():
            ret.append(rootNode)

            ret += rootNode.getAllChildNodes()

        return ret
841552
public function getFieldAnnotationsContainingMatchingTag($tag) {
        $matchingAnnotations = array();
        foreach ($this->getFieldAnnotations() as $field => $fieldAnnotations) {
            if (isset($fieldAnnotations[$tag])) {
                $matchingAnnotations[$field] = $fieldAnnotations;
            }
        }

        return $matchingAnnotations;

    }
321971
protected function getReportData(?string $tagContent = null): ?array
    {
        return [
            static::MESSAGE_TAG_CONTENT_FORMAT_INVALID,
            $this->stackPos,
            static::CODE_TAG_CONTENT_FORMAT_INVALID,
            [
                $tagContent,
                $this->getValidPattern()
            ]
        ];
    }
521974
public function getNodeByTagName($tagName)
    {
        $result = [];

        foreach ($this as $node) {
            if ($node->tagName === $tagName) {
                $result[] = $node;
            }
        }

        return $result;
    }
134227
private function getAllTags(): array
    {
        if ($this->tags === null) {
            $this->tags = $this->loadAllTags();
        }

        return $this->tags;
    }
922760
public function deleteTags($tagId)
    {
        $url = 'https://api.weixin.qq.com/cgi-bin/tags/delete?access_token=ACCESS_TOKEN';
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['tag' => ['id' => $tagId]]);
    }
1051979
public function resolveTagIds($tagIds)
    {
        $resolvedTags = [];

        foreach ($tagIds as $tagId) {
            $tag = $this->findById($tagId);
            if (null !== $tag) {
                $resolvedTags[] = $tag->getName();
            }
        }

        return $resolvedTags;
    }
656529
public static function existingTags(): Collection
    {
        return Tagged::query()
            ->distinct()
            ->join('tagging_tags', 'tag_slug', '=', 'tagging_tags.slug')
            ->where('taggable_type', '=', (new static)->getMorphClass())
            ->orderBy('tag_slug', 'ASC')
            ->get(array('tag_slug as slug', 'tag_name as name', 'tagging_tags.count as count'));
    }
837008
public function callbackSaveRelation($tagId)
    {
        $find = TagRelation::find()->where(['tag_id' => $tagId, 'table_name' => TaggableTrait::cleanBaseTableName($this->tableName), 'pk_id' => $this->getItemId()])->one();

        if ($find) {
            TagRelation::deleteAll(['tag_id' => $tagId, 'table_name' => TaggableTrait::cleanBaseTableName($this->tableName), 'pk_id' => $this->getItemId()]);
            return 0;
        } else {
            $model = new TagRelation();
            $model->setAttributes([
                'tag_id' => $tagId,
                'table_name' => TaggableTrait::cleanBaseTableName($this->tableName),
                'pk_id' => $this->getItemId(),
            ]);
            $model->insert(false);
            return 1;
        }
    }
700311
public function findEntitiesByCategoryIdsAndTags($locale, array $categoryIds = [], array $tags = [])
    {
        $products = $this->productRepository->findByCategoryIdsAndTags($locale, $categoryIds, $tags);

        return $products;
    }
1008351
protected function getTagValues()
    {
        // Step1 Get tags value from cache
        $keys = array_map(array($this, 'getTagKey'), $this->tags);
        $values = $this->cache->getMulti($keys);

        // Step2 Initialize new tags value
        $emptyKeys = array_diff($values, array_filter($values));
        if ($emptyKeys) {
            $newValues = $this->setTagValues($emptyKeys);
            $values = array_merge($values, $newValues);
        }

        return $values;
    }