class RelationLinkManager in Default Content 8
Hierarchy
- class \Drupal\hal\LinkManager\LinkManagerBase
- class \Drupal\hal\LinkManager\RelationLinkManager implements RelationLinkManagerInterface uses DeprecatedServicePropertyTrait
- class \Drupal\rest\LinkManager\RelationLinkManager implements RelationLinkManagerInterface
- class \Drupal\defaultcontent\LinkManager\RelationLinkManager
- class \Drupal\rest\LinkManager\RelationLinkManager implements RelationLinkManagerInterface
- class \Drupal\hal\LinkManager\RelationLinkManager implements RelationLinkManagerInterface uses DeprecatedServicePropertyTrait
Expanded class hierarchy of RelationLinkManager
File
- src/
LinkManager/ RelationLinkManager.php, line 12 - Contains \Drupal\defaultcontent\LinkManager\RelationLinkManager.
Namespace
Drupal\defaultcontent\LinkManagerView source
class RelationLinkManager extends RestRelationLinkManager {
/**
* {@inheritdoc}
*/
public function getRelationUri($entity_type, $bundle, $field_name) {
// Make the base path refer to drupal.org.x`
return "http://drupal.org/rest/relation/{$entity_type}/{$bundle}/{$field_name}";
}
/**
* {@inheritdoc}
*/
protected function writeCache() {
$data = array();
foreach ($this->entityManager
->getDefinitions() as $entity_type_id => $entity_type) {
$reflection = new \ReflectionClass($entity_type
->getClass());
// We are only interested in importing content entities.
if ($reflection
->implementsInterface('\\Drupal\\Core\\Config\\Entity\\ConfigEntityInterface') || !$reflection
->hasMethod('baseFieldDefinitions')) {
continue;
}
foreach (array_keys($this->entityManager
->getBundleInfo($entity_type_id)) as $bundle) {
foreach ($this->entityManager
->getFieldDefinitions($entity_type_id, $bundle) as $field_name => $field_details) {
$relation_uri = $this
->getRelationUri($entity_type_id, $bundle, $field_name);
$data[$relation_uri] = array(
'entity_type' => $entity_type_id,
'bundle' => $bundle,
'field_name' => $field_name,
);
}
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeprecatedServicePropertyTrait:: |
public | function | Allows to access deprecated/removed properties. | |
LinkManagerBase:: |
protected | property | Config factory service. | |
LinkManagerBase:: |
protected | property | Link domain used for type links URIs. | |
LinkManagerBase:: |
protected | property | The request stack. | |
LinkManagerBase:: |
protected | function | Gets the link domain. | |
LinkManagerBase:: |
public | function | ||
RelationLinkManager:: |
protected | property | ||
RelationLinkManager:: |
protected | property | ||
RelationLinkManager:: |
protected | property | The entity field manager. | |
RelationLinkManager:: |
protected | property | The entity bundle info. | |
RelationLinkManager:: |
protected | property | The entity type manager. | |
RelationLinkManager:: |
protected | property | Module handler service. | |
RelationLinkManager:: |
public | function |
Translates a REST URI into internal IDs. Overrides RelationLinkManagerInterface:: |
|
RelationLinkManager:: |
protected | function | Get the array of relation links. | |
RelationLinkManager:: |
public | function |
Gets the URI that corresponds to a field. Overrides RelationLinkManager:: |
|
RelationLinkManager:: |
protected | function |
Writes the cache of relation links. Overrides RelationLinkManager:: |
|
RelationLinkManager:: |
public | function | Constructor. |