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

@param integer $linkTypeId    The link type
@param string  $attributeCode The attribute code

@return array The link attribute
765470
public function getProductLinkAttribute($linkTypeId, $attributeCode)
    {

        // 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;
            }
        }
    }
1283256
public function getLinkField($linkType)
    {
        if (property_exists($this->data, 'links') && property_exists($this->data->links, $linkType)) {
            return $this->data->links->{$linkType};
        } else {
            return null;
        }
    }
186942
public CodeAttribute getCode()
  {
    for (int i = 0; i < _attributes.size(); i++) {
      Attribute attr = _attributes.get(i);

      if (attr instanceof CodeAttribute)
        return (CodeAttribute) attr;
    }

    return null;
  }
789004
protected void getLinkForAnnotationType(Content link, LinkInfo linkInfo, Type type) {
		link.addContent(getTypeAnnotationLinks(linkInfo));
		linkInfo.type = type.asAnnotatedType().underlyingType();
		link.addContent(getLink(linkInfo));
	}
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);
  }
135334
private function loadContentType(int $contentTypeId, array $languageCodes): ContentType
    {
        return $this->repository->getContentTypeService()->loadContentType($contentTypeId, $languageCodes);
    }
193606
public function createAttribute($code, array $attributeConfiguration = [])
    {
        $attributeClass = $this->attributeClass;
        /** @var AttributeInterface $attribute */
        $attribute = new $attributeClass(
            $code,
            $this->attributeTypeRegistry,
            $attributeConfiguration,
            $this->globalContextMask
        );
        if (method_exists($attribute, 'setTranslator')) {
            $attribute->setTranslator($this->translator);
        }

        return $attribute;
    }
323464
public function get($attributeCode, array $context = null)
    {
        $attribute = $this->getAttribute($attributeCode);

        $getter = 'get'.ucfirst($attributeCode);
        if (method_exists($this, $getter)) {
            return $this->$getter($context);
        }

        if ($attribute->isCollection()) {
            return $this->getValuesData($attribute, $context);
        }

        return $this->getValueData($attribute, $context);
    }
267222
protected function getLinkParams($linkName = null, $entityName = null, $isOrmEntityDefs = false, $returns = null)
    {
        if (!isset($linkName)) {
            $linkName = $this->getLinkName();
        }
        if (!isset($entityName)) {
            $entityName = $this->getEntityName();
        }

        $entityDefs = $this->getDefs($isOrmEntityDefs);
        $relationKeyName = $isOrmEntityDefs ? 'relations' : 'links';

        if (isset($entityDefs[$entityName]) && isset($entityDefs[$entityName][$relationKeyName][$linkName])) {
            return $entityDefs[$entityName][$relationKeyName][$linkName];
        }

        return $returns;
    }
1059445
static function fetchLinkList( $contentObjectAttributeID, $contentObjectAttributeVersion, $asObject = true )
    {
        $linkList = array();

        $urlObjectLinkList = self::fetchLinkObjectList( $contentObjectAttributeID, $contentObjectAttributeVersion, $asObject );

        foreach ( $urlObjectLinkList as $urlObjectLink )
        {
            if ( $asObject )
            {
                $linkID = $urlObjectLink->attribute( 'url_id' );
                $linkList[] = eZURL::fetch( $linkID );
            }
            else
            {
                $linkID = $urlObjectLink['url_id'];
                $linkList[] = $linkID;
            }
        }
        return $linkList;
    }
131703
public function getAttributesRawData($storeId, array $entityIds, $tableName, array $attributeIds)
    {
        $select = $this->connection->select();

        // The field modelizing the link between entity table and attribute values table. Either row_id or entity_id.
        $linkField = $this->getEntityMetaData($this->getEntityTypeId())->getLinkField();

        // The legacy entity_id field.
        $entityIdField = $this->getEntityMetaData($this->getEntityTypeId())->getIdentifierField();

        $joinStoreValuesConditionClauses = [
            "t_default.$linkField = t_store.$linkField",
            't_default.attribute_id = t_store.attribute_id',
            't_store.store_id= ?',
        ];

        $joinStoreValuesCondition = $this->connection->quoteInto(
            implode(' AND ', $joinStoreValuesConditionClauses),
            $storeId
        );

        $select->from(['entity' => $this->getEntityMetaData($this->getEntityTypeId())->getEntityTable()], [$entityIdField])
            ->joinInner(
                ['t_default' => $tableName],
                new \Zend_Db_Expr("entity.{$linkField} = t_default.{$linkField}"),
                ['attribute_id']
            )
            ->joinLeft(['t_store' => $tableName], $joinStoreValuesCondition, [])
            ->where('t_default.store_id=?', 0)
            ->where('t_default.attribute_id IN (?)', $attributeIds)
            ->where("entity.{$entityIdField} IN (?)", $entityIds)
            ->columns(['value' => new \Zend_Db_Expr('COALESCE(t_store.value, t_default.value)')]);

        return $this->connection->fetchAll($select);
    }
517480
public function getResultUrl($linked = false)
    {
        $linkText = $this->cObj->typoLink_URL($this->getResultLinkConfiguration());
        $linkText = htmlspecialchars($linkText);
        if ($linked) {
            return $this->cObj->typoLink($linkText, $this->getResultLinkConfiguration());
        }
        return $linkText;
    }
567240
protected void getLinkForTypeVariable(Content link, LinkInfo linkInfo, Type type) {
		link.addContent(getTypeAnnotationLinks(linkInfo));
		linkInfo.isTypeBound = true;
		final Doc owner = type.asTypeVariable().owner();
		if ((!linkInfo.excludeTypeParameterLinks) && owner instanceof ClassDoc) {
			linkInfo.classDoc = (ClassDoc) owner;
			final Content label = newContent();
			label.addContent(type.typeName());
			linkInfo.label = label;
			link.addContent(getClassLink(linkInfo));
		} else {
			link.addContent(type.typeName());
		}
		final Type[] bounds = type.asTypeVariable().bounds();
		if (!linkInfo.excludeTypeBounds) {
			linkInfo.excludeTypeBounds = true;
			final SARLFeatureAccess kw = Utils.getKeywords();
			for (int i = 0; i < bounds.length; ++i) {
				link.addContent(i > 0 ? " " + kw.getAmpersandKeyword() + " " //$NON-NLS-1$ //$NON-NLS-2$
						: " " + kw.getExtendsKeyword() + " "); //$NON-NLS-1$ //$NON-NLS-2$
				setBoundsLinkInfo(linkInfo, bounds[i]);
				link.addContent(getLink(linkInfo));
			}
		}
	}
873039
public function attributeByCode($attributeCode)
    {
        $attribute = $this->getFamily()->getAttribute($attributeCode);

        return $this->attribute($attribute);
    }
214528
private function nextLink(LinkType $link, ResourceObject $ro, $nextResource) : ResourceObject
    {
        $nextBody = $nextResource instanceof ResourceObject ? $nextResource->body : $nextResource;

        if ($link->type === LinkType::SELF_LINK) {
            $ro->body = $nextBody;

            return $ro;
        }

        if ($link->type === LinkType::NEW_LINK) {
            $ro->body[$link->key] = $nextBody;

            return $ro;
        }

        // crawl
        return $ro;
    }
1045686
public function getLinkA() {
		if($this->reverse()->isPolymorphic())
			return $this->reverse()->get('as').'_id';
		else
			return $this->reverse()->getName().'_id';
	}
1293375
private function findLinkNodes($siteRootId, $language, array $elementtypeIds)
    {
        $treeManager = $this->get('phlexible_tree.tree_manager');
        $elementService = $this->get('phlexible_element.element_service');

        $iconResolver = $this->get('phlexible_element.icon_resolver');
        $db = $this->get('doctrine.dbal.default_connection');

        $qb = $db->createQueryBuilder();

        $qbElementtypeIds = array_map(function($id) use ($qb) {
            return $qb->expr()->literal($id);
        }, $elementtypeIds);

        $qb
            ->select('t.id')
            ->from('tree', 't')
            ->join('t', 'element', 'e', 't.type_id = e.eid')
            ->where($qb->expr()->eq('t.siteroot_id', $qb->expr()->literal($siteRootId)))
            ->andWhere($qb->expr()->in('e.elementtype_id', $qbElementtypeIds))
            ->orderBy('t.sort', 'ASC');

        $treeIds = array_column($db->fetchAll($qb->getSQL()), 'id');

        $data = [];

        $rootTreeId = null;

        foreach ($treeIds as $treeId) {
            $tree = $treeManager->getByNodeId($treeId);
            $node = $tree->get($treeId);

            $element = $elementService->findelement($node->getTypeId());
            $elementVersion = $elementService->findLatestElementVersion($element);

            if (!isset($data[$treeId])) {
                $data[$node->getId()] = [
                    'id' => $node->getId(),
                    'eid' => $node->getTypeId(),
                    'text' => $elementVersion->getBackendTitle($language, $element->getMasterLanguage()).' ['.$node->getId().']',
                    'icon' => $iconResolver->resolveElement($element),
                    'children' => [],
                    'leaf' => true,
                    'expanded' => false,
                    'disabled' => !in_array($element->getElementtypeId(), $elementtypeIds),
                ];
            }

            do {
                $parentNode = $tree->getParent($node);

                if (!$parentNode) {
                    $rootTreeId = $node->getId();
                    break;
                }

                if (!isset($data[$parentNode->getId()])) {
                    $element = $elementService->findElement($parentNode->getTypeId());
                    $elementVersion = $elementService->findLatestElementVersion($element);

                    $data[$parentNode->getId()] = [
                        'id' => $parentNode->getId(),
                        'eid' => $parentNode->getTypeId(),
                        'text' => $elementVersion->getBackendTitle($language, $element->getMasterLanguage()).' ['.$parentNode->getId().']',
                        'icon' => $iconResolver->resolveTreeNode($parentNode, $language),
                        'children' => [],
                        'leaf' => false,
                        'expanded' => false,
                        'disabled' => !in_array($element->getElementtypeId(), $elementtypeIds),
                    ];
                } else {
                    $data[$parentNode->getId()]['leaf'] = false;
                }

                $data[$parentNode->getId()]['children'][$node->getId()] = &$data[$node->getId()];

                $node = $parentNode;
            } while ($parentNode);
        }

        if (!count($data)) {
            return [];
        }

        $data = $this->stripLinkNodeKeys($data[$rootTreeId], $db);

        return $data['children'];
    }