Return's the link attribute for the passed link type and attribute code.

@param string $linkTypeCode  The link type code
@param string $attributeCode The attribute code

@return array The link attribute
774054
public function getProductLinkAttributeByLinkTypeCodeAndAttributeCode($linkTypeCode, $attributeCode)
    {

        // map the link type code => ID
        $linkTypeId = $this->mapLinkTypeCodeToLinkTypeId($linkTypeCode);

        // try to load the link attribute with the passed link type ID and attribute code
        foreach ($this->linkAttributes as $linkAttribute) {
            if ($linkAttribute[MemberNames::LINK_TYPE_ID] === $linkTypeId &&
                $linkAttribute[MemberNames::PRODUCT_LINK_ATTRIBUTE_CODE] === $attributeCode
            ) {
                // return the matching link attribute
                return $linkAttribute;
            }
        }
    }
125944
public function getAuthorizationCode($code)
    {
        if (!isset($this->authorizationCodes[$code])) {
            return false;
        }

        return array_merge(array(
            'authorization_code' => $code,
        ), $this->authorizationCodes[$code]);
    }
618526
private function getTieBreaker($scopeCode)
    {
        $path = self::BASE_RELEVANCE_CONFIG_XML_PREFIX . "/" . self::TIE_BREAKER_CONFIG_XML_PATH;

        return (float) $this->getConfigValue($path, $scopeCode);
    }
340882
protected static function toXpath($code, $type='html', $encoding='UTF-8') {
		$doc = new \DOMDocument();
		if ($type == 'xml')
			@$doc->loadXML('<?xml encoding="'.$encoding.'">' . $code);
		else
			@$doc->loadHTML('<?xml encoding="'.$encoding.'">' . $code);

		foreach($doc->childNodes as $item) {
			if($item->nodeType == XML_PI_NODE)
				$doc->removeChild($item); #remove encoding node
		}

		return new \DOMXPath($doc);
	}
510390
public function getFirstValueByAttributeCodeAsString(string $code, $asTitle = true)
    {
        $attributeValue = $this->getFirstValueByAttributeCode($code);

        if (!$attributeValue) {
            return "";
        }

        $field = $asTitle ? 'title' : 'value';

        return $attributeValue->$field;
    }
904295
public function getFamilyVariant($familyCode, $code): array
    {
        return $this->getFactory()
            ->createAkeneoPimAdapterFactory()
            ->createFamilyVariantApiAdapter()
            ->get($familyCode, $code);
    }
873039
public function attributeByCode($attributeCode)
    {
        $attribute = $this->getFamily()->getAttribute($attributeCode);

        return $this->attribute($attribute);
    }
347304
public static function getUrlFromCode($code, $addedArgs = array(), $anchor = null)
  {
    self::initialize();

    $code = self::clearQueryArg($code);

    if ($code == '_root') {
      return WebApp::url();
    }

    if (StringTools::right($code, 1) != '/') {
      $code .= '/';
    }

    $args = array('q' => $code);
    $args = array_merge($args, $addedArgs);
    return Url::getUrl(null, $args, true, $anchor);
  }
1070810
protected function getAttributeItem( $code, $type )
	{
		if( ( $item = $this->cache->get( $code, $type ) ) === null )
		{
			$manager = \Aimeos\MShop::create( $this->getContext(), 'attribute' );

			$item = $manager->createItem();
			$item->setType( $type );
			$item->setDomain( 'product' );
			$item->setLabel( $code );
			$item->setCode( $code );
			$item->setStatus( 1 );

			$item = $manager->saveItem( $item );

			$this->cache->set( $item );
		}

		return $item;
	}
178050
public function getAttributeOption($attributeCode, $code): array
    {
        return $this->getFactory()
            ->createAkeneoPimAdapterFactory()
            ->createAttributeOptionApiAdapter()
            ->get($attributeCode, $code);
    }
594271
protected function setHttpCode($httpCode = null)
    {
        if ($httpCode !== null) {
            $this->httpCode = (int) $httpCode;

            if (!HttpCode::exists($this->httpCode)) {
                throw new \DomainException('Http Code does not exist! (code: ' . $this->httpCode . ')');
            }
        }

        return $this;
    }
560072
private function linkbaseRefExists( $linkbaseRefType )
	{
		return isset( $this->linkbaseTypes[ $linkbaseRefType ] ) &&
			   count( $this->linkbaseTypes[ $linkbaseRefType ] );
	}
199586
public static function languageCountryLocaleCode($languageCode, $countryCode)
    {
        $countryLocaleCodes = static::countryLocaleCodes($countryCode);
        $languageLocaleCodes = static::languageLocaleCodes($languageCode);
        if ($localeCodes = array_intersect($languageLocaleCodes, $countryLocaleCodes)) {
            return reset($localeCodes);
        }

        return \Locale::composeLocale([
            'language' => $languageCode,
            'region' => $countryCode,
        ]);
    }
202051
public function mapLinkTypeCodeToColumnName($linkTypeCode)
    {

        // query whether or not the link type code has a mapping
        if (isset($this->linkTypeCodeToColumnNameMapping[$linkTypeCode])) {
            return $this->linkTypeCodeToColumnNameMapping[$linkTypeCode];
        }

        // return the passed link type code
        return $linkTypeCode;
    }
955953
def get_links_of_type(self, link_type):
        
        return (link for link in self.links if link.get('type', '') == link_type)
48527
public function resolve($scopeType, $scopeCode)
    {
        if (isset($this->resolvedScopeCodes[$scopeType][$scopeCode])) {
            return $this->resolvedScopeCodes[$scopeType][$scopeCode];
        }

        $resolverScopeCode = $scopeCode;

        if (($scopeCode === null || is_numeric($scopeCode))
            && $scopeType !== ScopeConfigInterface::SCOPE_TYPE_DEFAULT
        ) {
            $scopeResolver     = $this->scopeResolverPool->get($scopeType);
            $resolverScopeCode = $scopeResolver->getScope($scopeCode);
        }

        if ($resolverScopeCode instanceof \Magento\Framework\App\ScopeInterface) {
            $resolverScopeCode = $resolverScopeCode->getCode();
        }

        $this->resolvedScopeCodes[$scopeType][$scopeCode] = $resolverScopeCode;

        return $resolverScopeCode;
    }
155748
private function validateXLinkResourceAttributes( $xlinkAttributes, $linkbase )
	{
		if ( ! XBRL::isValidating() ) return true;

		$result = true;

		if ( ! property_exists( $xlinkAttributes, 'type' ) )
		{
			$this->reportMissingResourceAttribute( '3.5.3.8.1', 'type', $linkbase );
			$result = false;
		}

		if ( ! property_exists( $xlinkAttributes, 'role' ) )
		{
			$this->reportMissingResourceAttribute( '3.5.3.8.3', 'role', $linkbase );
			$result = false;
		}

		if ( ! property_exists( $xlinkAttributes, 'label' ) )
		{
			$this->reportMissingResourceAttribute( '3.5.3.8.2', 'label', $linkbase );
			$result = false;
		}

		return true;
	}