Creates a new synonym using the given $keyword for tag $tag.

@param \Netgen\TagsBundle\SPI\Persistence\Tags\SynonymCreateStruct $createStruct
@param array $tag

@throws \RuntimeException

@return \Netgen\TagsBundle\SPI\Persistence\Tags\Tag
487506
public function createSynonym(SynonymCreateStruct $createStruct, array $tag)
    {
        try {
            return $this->innerGateway->createSynonym($createStruct, $tag);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
378190
public function createGroup(GroupCreateStruct $createStruct)
    {
        $group = $this->mapper->createGroupFromCreateStruct(
            $createStruct
        );

        $group->id = $this->contentTypeGateway->insertGroup(
            $group
        );

        return $group;
    }
88409
public static function createFromToken(TagToken $token) : Tag
    {
        $tagName = $token->getTagName();
        $attribute = $token->getAttribute();
        return new Tag($tagName, $attribute);
    }
829151
private function buildItem(Tag $tag): Item
    {
        $tagName = $this->translationHelper->getTranslatedByMethod(
            $tag,
            'getKeyword'
        );

        return new Item($tag, (string) $tagName);
    }
1335654
public final Morpheme createMorpheme(final String word, final String tag) {
    final Morpheme morpheme = new Morpheme();
    morpheme.setValue(word);
    morpheme.setTag(tag);
    return morpheme;
  }
390683
private function processTag( eZTagsObject $tag, array &$tagIDs, array &$keywords, $indexParentTags = false, $includeSynonyms = false )
    {
        if ( !$this->indexSynonyms && $tag->isSynonym() )
            $tag = $tag->getMainTag();

        //get keyword in content's locale
        $keyword = $tag->getKeyword( $this->ContentObjectAttribute->attribute( 'language_code' ) );
        if ( !$keyword )
        {
            //fall back to main language
            /** @var eZContentLanguage $mainLanguage */
            $mainLanguage = eZContentLanguage::fetch( $tag->attribute( 'main_language_id') );
            if ( $mainLanguage instanceof eZContentLanguage )
                $keyword = $tag->getKeyword( $mainLanguage->attribute( 'locale' ) );
        }

        if ( $keyword )
        {
            $tagIDs[] = (int) $tag->attribute( 'id' );
            $keywords[] = $keyword;
        }

        if ( $indexParentTags )
        {
            $parentTags = $tag->getPath( true );
            foreach ( $parentTags as $parentTag )
            {
                if ( $parentTag instanceof eZTagsObject )
                {
                    $this->processTag( $parentTag, $tagIDs, $keywords );
                }
            }
        }

        if ( $this->indexSynonyms && $includeSynonyms )
        {
            foreach ( $tag->getSynonyms() as $synonym )
            {
                if ( $synonym instanceof eZTagsObject )
                {
                    $this->processTag( $synonym, $tagIDs, $keywords );
                }
            }
        }
    }
872408
@SuppressWarnings("unchecked")
    public T addTag(String tag) {
        if (this.tags_ == null) {
            tags_ = new ArrayList<>();
        }
        this.tags_.add(tag);
        return (T) this;
    }
602576
public void createTag(final String tagUrl, final String commitMessage)
            throws IOException, InterruptedException {
        build.getWorkspace()
                .act(new SVNCreateTagCallable(tagUrl, commitMessage, getLocation(), getSvnAuthenticationProvider(build),
                        buildListener));
    }
714082
public static function tag( $name, $param1 = null, $param2 = null ) 
	{
		return static::create( $name, $param1, $param2 );
	}
861473
public function addTag($tag, $message = null)
    {
        if ($message === null) {
            $message = $tag;
        }
        return $this->run("tag -a $tag -m $message");
    }
77383
public function create(string $tag, string $message, string $object, string $type, array $tagger = []): array
    {
        return $this->getApi()->request($this->getApi()
                                             ->sprintf('/repos/:owner/:repo/git/tags', $this->getGitData()->getOwner(),
                                                 $this->getGitData()->getRepo()), Request::METHOD_POST, [
                'tag'     => $tag,
                'message' => $message,
                'object'  => $object,
                'type'    => $type,
                'tagger'  => $tagger
            ]);
    }
307982
public function createTag($tag, $message = null)
    {
        $command = 'tag';

        if ($message) {
            $command .= " -a -m '$message'";
        }

        $command .= " $tag";

        $this->getClient()->run($this, $command);
    }
1330039
public function newSynonymCreateStruct($mainTagId, $mainLanguageCode)
    {
        $synonymCreateStruct = new SynonymCreateStruct();
        $synonymCreateStruct->mainTagId = $mainTagId;
        $synonymCreateStruct->mainLanguageCode = $mainLanguageCode;

        return $synonymCreateStruct;
    }
530286
public function doGenerate($tag, array $parameters)
    {
        if (isset($parameters['siteaccess'])) {
            // We generate for a different siteaccess, so potentially in a different language.
            $languages = $this->configResolver->getParameter('languages', null, $parameters['siteaccess']);
            unset($parameters['siteaccess']);
        } else {
            $languages = $this->configResolver->getParameter('languages');
        }

        $tagUrl = '';
        $isInternal = false;
        $originalTagId = $tagId = $tag->id;

        try {
            do {
                $tag = $this->tagsService->loadTag($tagId, $languages);

                $tagKeyword = null;
                foreach ($languages as $language) {
                    $tagKeyword = $tag->getKeyword($language);
                    if (!empty($tagKeyword)) {
                        break;
                    }
                }

                if (empty($tagKeyword)) {
                    if ($tag->alwaysAvailable) {
                        $tagKeyword = $tag->getKeyword();
                    }

                    if (empty($tagKeyword)) {
                        throw new LogicException("Unknown error when generating URL for tag ID #{$originalTagId}");
                    }
                }

                $tagUrl = '/' . $tagKeyword . $tagUrl;

                $tagId = $tag->parentTagId;
            } while ($tagId > 0);
        } catch (NotFoundException $e) {
            $isInternal = true;
            $tagUrl = $this->defaultRouter->generate(
                self::INTERNAL_TAG_ROUTE,
                [
                    'tagId' => $originalTagId,
                ]
            );
        } catch (LogicException $e) {
            if ($this->logger !== null) {
                $this->logger->warning($e->getMessage());
            }

            $isInternal = true;
            $tagUrl = $this->defaultRouter->generate(
                self::INTERNAL_TAG_ROUTE,
                [
                    'tagId' => $originalTagId,
                ]
            );
        }

        $queryString = '';
        if (!empty($parameters)) {
            $queryString = '?' . http_build_query($parameters, '', '&');
        }

        return (!$isInternal ? $this->getPathPrefix() : '') . '/' . trim($tagUrl, '/') . $queryString;
    }
950203
public static function withTag($tag)
    {
        $element = (new ReflectionClass(static::class))->newInstanceWithoutConstructor();

        $element->tag = $tag;
        $element->attributes = new Attributes();
        $element->children = new Collection();

        return $element;
    }
43123
public function addTag($tag)
    {
        $this->tags[] = (string)$tag;
        $this->ref = null;
        return $this;
    }
1366567
public function create(CreateStruct $createStruct, array $parentTag = null)
    {
        try {
            return $this->innerGateway->create($createStruct, $parentTag);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }