You are here

public function PreviewEntity::preview in Acquia Content Hub 8.2

Preview the entity.

Parameters

string $uuid: Uuid of entity.

Return value

array View array of entity.

Throws

\Drupal\Core\Entity\EntityStorageException

1 string reference to 'PreviewEntity::preview'
acquia_contenthub_preview.routing.yml in modules/acquia_contenthub_preview/acquia_contenthub_preview.routing.yml
modules/acquia_contenthub_preview/acquia_contenthub_preview.routing.yml

File

modules/acquia_contenthub_preview/src/Controller/PreviewEntity.php, line 73

Class

PreviewEntity
Controller for previewing entities in content as a service.

Namespace

Drupal\acquia_contenthub_preview\Controller

Code

public function preview(string $uuid) {
  $entity = $this->repository
    ->loadEntityByUuid('node', $uuid);
  return $this->controller
    ->view($entity);
}