$parameters[$definition['entity_type'
]]['type'
] = 'entity:' .
$definition['entity_type'
];
$route->
setOption('parameters',
$parameters);
return $route;
} /**
* {@inheritdoc}
*/
public function availableMethods() { $methods = parent::
availableMethods();
if ($this->
isConfigEntityResource()) { // Currently only GET is supported for Config Entities.
// @todo Remove when supported https://www.drupal.org/node/2300677
$unsupported_methods =
['POST', 'PUT', 'DELETE', 'PATCH'
];
$methods =
array_diff($methods,
$unsupported_methods);
} return $methods;
} /**
* Checks if this resource is for a Config Entity.
*
* @return bool
* TRUE if the entity is a Config Entity, FALSE otherwise.
*/