public function TypeLinkManager::getTypeUri in Default Content 8
Gets the URI that corresponds to a bundle.
When using hypermedia formats, this URI can be used to indicate which bundle the data represents. Documentation about required and optional fields can also be provided at this URI.
Parameters
$entity_type: The bundle's entity type.
$bundle: The bundle name.
array $context: (optional) Optional serializer/normalizer context.
Return value
string The corresponding URI for the bundle.
Overrides TypeLinkManager::getTypeUri
File
- src/
LinkManager/ TypeLinkManager.php, line 20 - Contains \Drupal\defaultcontent\LinkManager\TypeLinkManager.
Class
- TypeLinkManager
- Creates a type link manager that references drupal.org as the domain.
Namespace
Drupal\defaultcontent\LinkManagerCode
public function getTypeUri($entity_type, $bundle, $context = array()) {
// Make the base path refer to drupal.org.
return "http://drupal.org/rest/type/{$entity_type}/{$bundle}";
}