Responds to entity GET requests.
mixed $id: The entity ID.
\Drupal\rest\ResourceResponse The response containing the loaded entity.
\Symfony\Component\HttpKernel\Exception\HttpException
public function get($id) {
$definition = $this
->getDefinition();
$entity = entity_load($definition['entity_type'], $id);
if ($entity) {
return new ResourceResponse($entity);
}
throw new NotFoundHttpException(t('Entity with ID @id not found', array(
'@id' => $id,
)));
}