You are here

class PreSendPdfEvent in Entity Print 8

The PreSendPdfEvent class.

Hierarchy

  • class \Drupal\entity_print\Event\PdfEventBase extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of PreSendPdfEvent

2 files declare their use of PreSendPdfEvent
EntityPrintPdfBuilder.php in src/EntityPrintPdfBuilder.php
TestEngineConfigurationAlter.php in tests/modules/entity_print_test/src/EventSubscriber/TestEngineConfigurationAlter.php

File

src/Event/PreSendPdfEvent.php, line 11

Namespace

Drupal\entity_print\Event
View source
class PreSendPdfEvent extends PdfEventBase {

  /**
   * @var \Drupal\Core\Entity\EntityInterface
   */
  protected $entity;

  /**
   * PreSendPdfEvent constructor.
   *
   * @param \Drupal\entity_print\Plugin\PdfEngineInterface $pdf_engine
   *   The PDF Engine.
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity to print.
   */
  public function __construct(PdfEngineInterface $pdf_engine, EntityInterface $entity) {
    parent::__construct($pdf_engine);
    $this->entity = $entity;
  }

  /**
   * Gets the entity that is being printed to PDF.
   *
   * @return \Drupal\Core\Entity\EntityInterface
   *   The content entity.
   */
  public function getEntity() {
    return $this->entity;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PdfEventBase::$pdfEngine protected property
PdfEventBase::getPdfEngine public function Gets the PDF Engine plugin that will print the PDF.
PreSendPdfEvent::$entity protected property
PreSendPdfEvent::getEntity public function Gets the entity that is being printed to PDF.
PreSendPdfEvent::__construct public function PreSendPdfEvent constructor. Overrides PdfEventBase::__construct