public function PreviewEntity::__construct in Acquia Content Hub 8.2
Same name in this branch
- 8.2 modules/acquia_contenthub_preview/src/Controller/PreviewEntity.php \Drupal\acquia_contenthub_preview\Controller\PreviewEntity::__construct()
- 8.2 modules/acquia_contenthub_preview/src/EventSubscriber/HandleWebhook/PreviewEntity.php \Drupal\acquia_contenthub_preview\EventSubscriber\HandleWebhook\PreviewEntity::__construct()
PreviewEntity constructor.
Parameters
\Drupal\Core\Entity\EntityRepositoryInterface $repository: Entity Repository.
\Drupal\Core\DependencyInjection\ClassResolverInterface $resolver: Class Resolver.
File
- modules/
acquia_contenthub_preview/ src/ Controller/ PreviewEntity.php, line 46
Class
- PreviewEntity
- Controller for previewing entities in content as a service.
Namespace
Drupal\acquia_contenthub_preview\ControllerCode
public function __construct(EntityRepositoryInterface $repository, ClassResolverInterface $resolver) {
$this->repository = $repository;
$this->resolver = $resolver;
$this->controller = $this->resolver
->getInstanceFromDefinition('\\Drupal\\Core\\Entity\\Controller\\EntityViewController');
}