LinkManager.php in Drupal 9
File
core/modules/hal/src/LinkManager/LinkManager.php
View source
<?php
namespace Drupal\hal\LinkManager;
class LinkManager implements LinkManagerInterface {
protected $typeLinkManager;
protected $relationLinkManager;
public function __construct(TypeLinkManagerInterface $type_link_manager, RelationLinkManagerInterface $relation_link_manager) {
$this->typeLinkManager = $type_link_manager;
$this->relationLinkManager = $relation_link_manager;
}
public function getTypeUri($entity_type, $bundle, $context = []) {
return $this->typeLinkManager
->getTypeUri($entity_type, $bundle, $context);
}
public function getTypeInternalIds($type_uri, $context = []) {
return $this->typeLinkManager
->getTypeInternalIds($type_uri, $context);
}
public function getRelationUri($entity_type, $bundle, $field_name, $context = []) {
return $this->relationLinkManager
->getRelationUri($entity_type, $bundle, $field_name, $context);
}
public function getRelationInternalIds($relation_uri) {
return $this->relationLinkManager
->getRelationInternalIds($relation_uri);
}
public function setLinkDomain($domain) {
$this->relationLinkManager
->setLinkDomain($domain);
$this->typeLinkManager
->setLinkDomain($domain);
return $this;
}
}