class AppTitleProvider in Apigee Edge 8
Developer- and company (team) app specific title overrides and additions.
Hierarchy
- class \Drupal\Core\Entity\Controller\EntityController implements ContainerInjectionInterface uses UrlGeneratorTrait, StringTranslationTrait
- class \Drupal\apigee_edge\Entity\EdgeEntityTitleProvider
- class \Drupal\apigee_edge\Entity\AppTitleProvider
- class \Drupal\apigee_edge\Entity\EdgeEntityTitleProvider
Expanded class hierarchy of AppTitleProvider
1 file declares its use of AppTitleProvider
- TeamAppRouteProvider.php in modules/
apigee_edge_teams/ src/ Entity/ TeamAppRouteProvider.php
File
- src/
Entity/ AppTitleProvider.php, line 29
Namespace
Drupal\apigee_edge\EntityView source
class AppTitleProvider extends EdgeEntityTitleProvider {
/**
* Provides a title for the app analytics page.
*
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The route match.
* @param \Drupal\Core\Entity\EntityInterface $_entity
* (optional) An entity, passed in directly from the request attributes.
*
* @return string|null
* The title for the app analytics page, null if an entity was found.
*/
public function analyticsTitle(RouteMatchInterface $route_match, EntityInterface $_entity = NULL) {
if ($entity = $this
->doGetEntity($route_match, $_entity)) {
return $this
->t('Analytics of %label @entity_type', [
'%label' => $entity
->label(),
'@entity_type' => mb_strtolower($this->entityTypeManager
->getDefinition($entity
->getEntityTypeId())
->getSingularLabel()),
]);
}
}
/**
* {@inheritdoc}
*/
protected function doGetEntity(RouteMatchInterface $route_match, EntityInterface $_entity = NULL) {
if ($_entity) {
$entity = $_entity;
}
else {
// Let's look up in the route object for apps only.
foreach ($route_match
->getParameters() as $parameter) {
if ($parameter instanceof AppInterface) {
$entity = $parameter;
break;
}
}
}
if (isset($entity)) {
return $this->entityRepository
->getTranslationFromContext($entity);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AppTitleProvider:: |
public | function | Provides a title for the app analytics page. | |
AppTitleProvider:: |
protected | function |
Determines the entity. Overrides EntityController:: |
|
EdgeEntityTitleProvider:: |
public | function |
Provides a generic delete title callback. Overrides EntityController:: |
|
EdgeEntityTitleProvider:: |
public | function |
Provides a generic edit title callback. Overrides EntityController:: |
|
EdgeEntityTitleProvider:: |
public | function |
Provides a generic title callback for a single entity. Overrides EntityController:: |
|
EntityController:: |
protected | property | The entity repository. | |
EntityController:: |
protected | property | The entity type bundle info. | |
EntityController:: |
protected | property | The entity manager. | |
EntityController:: |
protected | property | The renderer. | |
EntityController:: |
public | function | Provides a generic add title callback for entities with bundles. | |
EntityController:: |
public | function | Displays add links for the available bundles. | |
EntityController:: |
public | function | Provides a generic add title callback for an entity type. | |
EntityController:: |
public static | function |
Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: |
|
EntityController:: |
protected | function | Expands the bundle information with descriptions, if known. | |
EntityController:: |
protected | function |
Returns a redirect response object for the specified route. Overrides UrlGeneratorTrait:: |
|
EntityController:: |
public | function | Constructs a new EntityController. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
UrlGeneratorTrait:: |
protected | property | The url generator. | |
UrlGeneratorTrait:: |
protected | function | Returns the URL generator service. | |
UrlGeneratorTrait:: |
public | function | Sets the URL generator service. | |
UrlGeneratorTrait:: |
protected | function | Generates a URL or path for a specific route based on the given parameters. |