You are here

protected function TeamApp::urlRouteParameters in Apigee Edge 8

Gets an array of placeholders for this entity.

Individual entity classes may override this method to add additional placeholders if desired. If so, they should be sure to replicate the property caching logic.

Parameters

string $rel: The link relationship type, for example: canonical or edit-form.

Return value

array An array of URI placeholders.

Overrides EntityBase::urlRouteParameters

File

modules/apigee_edge_teams/src/Entity/TeamApp.php, line 185

Class

TeamApp
Defines the Team (company) app entity class.

Namespace

Drupal\apigee_edge_teams\Entity

Code

protected function urlRouteParameters($rel) {
  $params = parent::urlRouteParameters($rel);
  $link_templates = $this
    ->linkTemplates();
  if (isset($link_templates[$rel])) {
    if (strpos($link_templates[$rel], '{team}') !== FALSE) {
      $params['team'] = $this
        ->getCompanyName();
    }
    if (strpos($link_templates[$rel], '{app}') !== FALSE) {
      $params['app'] = $this
        ->getName();
    }
    if (strpos($link_templates[$rel], '{team_app}') === FALSE) {
      unset($params['team_app']);
    }
  }
  return $params;
}