Tag group helper function
@param string $groupName
@return bool
341661
public function isInGroup($groupName): bool
    {
        if ($this->group && ($this->group->slug == $this->taggingUtility->slug($groupName))) {
            return true;
        }
        return false;
    }
432325
protected function getElementGroup($elementName)
    {
        $returnValue =  '';

		foreach($this->groups as $groupName => $group){
				if(in_array($elementName, $group['elements'])){
					$returnValue = $groupName;
					break;
				}
		}

        return $returnValue;
    }
54163
public function hasTag($name)
    {
        foreach ($this->tags as $tag) {
            if (strtolower($tag->getName()) == $name) {
                return true;
            }
        }
        return false;
    }
976906
public static function createByName(string $tag, string $group = null, string $locale = null): self
    {
        $locale = $locale ?? app()->getLocale();

        return static::create([
            'name' => [$locale => $tag],
            'group' => $group,
        ]);
    }
922717
public function getUrlByTag($tagName)
    {
        if (isset($this->urls[$tagName])) {
            return $this->urls[$tagName];
        } else {
            return null;
        }
    }
971060
public function setGroupName($groupName)
    {
        $group = posix_getgrnam($groupName);
        if (! isset($group['gid'])) {
            throw new InvalidArgumentException(sprintf('"%s" is not a valid group name', $groupName));
        }

        $this->setGroupId($group['gid']);
    }
719099
public static function createByName(string $name, string $locale = null, string $group = null): Tag
    {
        $locale = $locale ?? app()->getLocale();

        return static::create([
            'name' => [$locale => $name],
            'group' => $group,
        ]);
    }
202496
public function scopeInGroup(Builder $query, $groupName)
    {
        $groupSlug = $this->taggingUtility->slug($groupName);

        return $query->whereHas('group', function (Builder $query) use ($groupSlug) {
            $query->where('slug', $groupSlug);
        });
    }
704540
protected function validateData(EntityGroup $group, $groupname)
    {
        $errors = array();
        
        // Groupname
        if ($this->groupManager->hasGroupForName($groupname) && $this->groupManager->getGroupForName($groupname)->getUuid() != $group->getUuid()) {
            $errors[] = new Error(Error::GENERAL_ERROR, $this->translate('The groupname is already in use.', '\\Zepi\\Web\\AccessControl'));
        }
        
        if (count($errors) > 0) {
            return $errors;
        }
        
        return true;
    }
179427
public function insertPausedTriggerGroup($groupName)
    {
        $result = $this->res->getPausedTriggerCol()->updateOne(
            ['groupName' => $groupName],
            ['$set' => ['groupName' => $groupName]],
            ['upsert' => true]
        );

        return $result->isAcknowledged() && $result->getUpsertedCount();
    }
1280535
private function getTagDate($tagName)
    {
        /** @var \Platformsh\Cli\Service\Git $git */
        $git = $this->getService('git');
        $date = $git->execute(['log', '-1', '--format=%aI', 'refs/tags/' . $tagName]);

        return is_string($date) ? strtotime(trim($date)) : false;
    }
1335703
public function hasPhpdocTag($reflection, string $tagName): bool
    {
        return !empty($this->getTags($reflection, $tagName));
    }
666407
private static function select_optgroup($groupname, $options, array $selected) {
        if (empty($options)) {
            return '';
        }
        $attributes = array('label'=>$groupname);
        $output = '';
        foreach ($options as $value=>$label) {
            $output .= self::select_option($label, $value, $selected);
        }
        return self::tag('optgroup', $output, $attributes);
    }
1102051
public function hasTag(string $name): bool
    {
        /** @var Tag $tag */
        foreach ($this->getTags() as $tag) {
            if ($tag->getName() === $name) {
                return true;
            }
        }

        return false;
    }
582980
public function createTag($tagName)
    {
        $result = $this->httpRaw(self::WECHAT_TAG_CREATE_PREFIX, [
            'tagname' => $tagName
        ], [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'ok' ? $result['tagid'] : $this->dump($result);
    }
1015574
public function Js ($groupName = self::GROUP_NAME_DEFAULT) {
		$this->actualGroupName = $groupName;
		$this->_getScriptsGroupContainer($groupName);
		return $this;
	}
1258681
public function findByGroupName($groupName)
    {
        return $this->searchForOneNode(
            $this->buildFilter(
                new Filter\StringFilter($this->connection->getConfiguration()->getGroupNameAttribute() . '=' . Filter\AbstractFilter::escapeValue($groupName))
            )
        );
    }