You are here

protected function DeveloperApp::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

src/Entity/DeveloperApp.php, line 275

Class

DeveloperApp
Defines the Developer app entity class.

Namespace

Drupal\apigee_edge\Entity

Code

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