You are here

public function Email::getEvent in Commerce Email 8

Gets the email event.

Return value

\Drupal\commerce_email\Plugin\Commerce\EmailEvent\EmailEventInterface The email event.

Overrides EmailInterface::getEvent

File

src/Entity/Email.php, line 159

Class

Email
Defines the email entity class.

Namespace

Drupal\commerce_email\Entity

Code

public function getEvent() {
  if ($this->event) {

    /** @var \Drupal\Core\Plugin\DefaultPluginManager $email_event_manager */
    $email_event_manager = \Drupal::service('plugin.manager.commerce_email_event');
    return $email_event_manager
      ->createInstance($this->event);
  }
}