public function NodeTypePreviewImageForm::__construct in Acquia Content Hub 8
Constructor.
Parameters
\Drupal\acquia_contenthub\EntityManager $entity_manager: The Entity Manager.
\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The Entity Type Manager.
\Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager: The Entity Field Manager.
File
- src/
Form/ NodeTypePreviewImageForm.php, line 76
Class
- NodeTypePreviewImageForm
- Defines a form that alters node type form to add a preview image form.
Namespace
Drupal\acquia_contenthub\FormCode
public function __construct(EntityManager $entity_manager, EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager) {
// We are assuming this is ONLY working for 'node' entities. If preview
// images are to be supported for entities other than nodes, we will need
// to change this line.
$this->contenthubEntityConfig = $entity_manager
->getContentHubEntityTypeConfigurationEntity('node');
$this->entityTypeManager = $entity_type_manager;
$this->entityFieldManager = $entity_field_manager;
}