Returns the main translation of this tag

@return eZTagsKeyword
434210
public function getMainTranslation()
    {
        /** @var eZContentLanguage $language */
        $language = eZContentLanguage::fetch( $this->attribute( 'main_language_id' ) );
        if ( $language instanceof eZContentLanguage )
            return $this->translationByLocale( $language->attribute( 'locale' ) );

        return false;
    }
1019236
public function getTagKeyword($tag)
    {
        if (!$tag instanceof Tag) {
            try {
                $tag = $this->tagsService->loadTag($tag);
            } catch (NotFoundException $e) {
                return '';
            }
        }

        return $this->translationHelper->getTranslatedByMethod($tag, 'getKeyword');
    }
580141
public function label()
    {
        if ($this->label_translated) {
            return cms_trans($this->label_translated);
        }

        if ($this->label) {
            return $this->label;
        }

        return ucfirst(str_replace('_', ' ', snake_case($this->source)));
    }
777791
protected function parseFragment()
    {
        $start = $this->token->getStart();
        $this->expect(Token::SPREAD_TYPE);

        if ($this->token->getValue() === 'on') {
            $this->advance();

            return new InlineFragment(
                $this->parseNamedType(),
                $this->parseDirectives(),
                $this->parseSelectionSet(),
                $this->location($start)
            );
        }

        return new FragmentSpread(
            $this->parseFragmentName(),
            $this->parseDirectives(),
            $this->location($start)
        );
    }
645076
public function getAsBBCode() {
        $str = "[".$this->tagName;
        if( $this->attribute != null )
            $str .= "=" . $this->attribute;
        $str .= "]";
        foreach( $this->getChildren() as $child)
            $str .= $child->getAsBBCode();
        $str .= "[/".$this->tagName."]";
        return $str;
    }
1049832
public function getTag() {
		if($this->exists()) {
			$url = $this->getURL();
			$title = ($this->Title) ? $this->Title : $this->Filename;
			if($this->Title) {
				$title = Convert::raw2att($this->Title);
			} else {
				if(preg_match("/([^\/]*)\.[a-zA-Z0-9]{1,6}$/", $title, $matches)) {
					$title = Convert::raw2att($matches[1]);
				}
			}
			return "<img src=\"$url\" alt=\"$title\" ".$this->getAttributesHTML()." />";
		}
	}
246477
public function getTags() {
        return implode(",", array_keys(ArrayHelper::map($this->owner->getModelTags()->asArray()->all(), 'name', 'name')));
    }
137323
public function getSortedTags() {
		if ($this->comparator === null) {
			$this->comparator = new TagNameComparator(); 
		}

		// 1) group by tag name
		$group = new Map();
		foreach ($this->tags as $tag) {
			if (!$group->has($tag->getTagName())) {
				$group->set($tag->getTagName(), new ArrayList());
			}
			
			$group->get($tag->getTagName())->add($tag);
		} 
		
		// 2) Sort the group by tag name
		$group->sortKeys(new TagNameComparator());
		
		// 3) flatten the group
		$sorted = new ArrayList();
		foreach ($group->values() as $tags) {
			$sorted->addAll($tags);
		}
		
		return $sorted;
	}
1309023
public function getIcon()
    {
        $ini = eZINI::instance( 'eztags.ini' );
        /** @var array $iconMap */
        $iconMap = $ini->variable( 'Icons', 'IconMap' );
        $defaultIcon = $ini->variable( 'Icons', 'Default' );

        if ( $this->attribute( 'main_tag_id' ) > 0 )
            $tag = $this->getMainTag( true );
        else
            $tag = $this;

        $tagID = $tag->attribute( 'id' );
        if ( array_key_exists( $tagID, $iconMap ) && !empty( $iconMap[$tagID] ) )
            return $iconMap[$tagID];

        /** @var eZTagsObject[] $path */
        $path = $tag->getPath( true, true );
        if ( is_array( $path ) && !empty( $path ) )
        {
            foreach ( $path as $pathElement )
            {
                $pathElementID = $pathElement->attribute( 'id' );
                if ( array_key_exists( $pathElementID, $iconMap ) && !empty( $iconMap[$pathElementID] ) )
                    return $iconMap[$pathElementID];
            }
        }

        return $defaultIcon;
    }
1371555
public function getTplLanguage()
    {
        if ($this->_iTplLanguageId === null) {
            $iSessLang = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('tpllanguage');
            $this->_iTplLanguageId = $this->isAdmin() ? $this->setTplLanguage($iSessLang) : $this->getBaseLanguage();
        }

        return $this->_iTplLanguageId;
    }
215025
public function getLanguage()
    {
        if (!$this->language) {
            $langs = $this->getBrowserLanguage();
            // creating output list
            $accepted = array();
            foreach ($langs as $lang) {
                $accepted[] = $this->extractDataOfLanguage($lang);
            }
            // sorting the list by coefficient desc
            krsort($accepted);
            if (isset($accepted[0])) {
                $this->language = $accepted[0]['code'];
            }
        }

        return $this->language;
    }
978960
protected function getTranslator()
    {
        if ( null === $this->_translator )
        {
            $this->_translator = $this->getServiceLocator()
                                      ->get( 'Zend\I18n\Translator\Translator' );
        }

        return $this->_translator;
    }
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;
    }
110012
public function getTranslation()
    {
        $attributeValueTranslation = $this->getTranslationByLocale($this->locale);

        if (!$attributeValueTranslation) {
            $attributeValueTranslation = $this->getTranslationByLocale($this->fallbackLocale);
        }

        if (!$attributeValueTranslation) {
            $attributeValueTranslation = new AttributeValueTranslation();
            $attributeValueTranslation->setLocale($this->locale);
            $attributeValueTranslation->setAttributeValue($this->entity);

            $this->entity->addTranslation($attributeValueTranslation);
        }

        return $attributeValueTranslation;
    }
178174
public function getAsBBCode()
    {
        $str = "[".$this->tagName;
        if (!empty($this->attribute)) {
            if (isset($this->attribute[$this->tagName])) {
                $str .= "=".$this->attribute[$this->tagName];
            }

            foreach ($this->attribute as $key => $value) {
                if ($key == $this->tagName) {
                    continue;
                } else {
                    $str .= " ".$key."=" . $value;
                }
            }
        }
        $str .= "]";
        foreach ($this->getChildren() as $child) {
            $str .= $child->getAsBBCode();
        }
        $str .= "[/".$this->tagName."]";

        return $str;
    }
1175408
public function getHasTranslate()
    {
        $relations = $this->getRelation();
        $select = array_keys($relations->link);
        $select[] = $this->languageAttribute;

        return $relations
            ->select($select)
            ->indexBy($this->languageAttribute)
            ->asArray();
    }
243271
public function getParentString()
    {
        $keywordsArray = array();

        /** @var eZTagsObject[] $path */
        $path = $this->getPath( false, true );
        if ( is_array( $path ) && !empty( $path ) )
        {
            foreach ( $path as $tag )
            {
                $synonymsCount = $tag->getSynonymsCount( true );
                $keywordsArray[] = $synonymsCount > 0 ? $tag->attribute( 'keyword' ) . ' (+' . $synonymsCount . ')' : $tag->attribute( 'keyword' );
            }
        }

        $synonymsCount = $this->getSynonymsCount( true );
        $keywordsArray[] = $synonymsCount > 0 ? $this->attribute( 'keyword' ) . ' (+' . $synonymsCount . ')' : $this->attribute( 'keyword' );

        return implode( ' / ', $keywordsArray );
    }