You are here

protected function ContactPopupBlock::getContactForm in Contact Form Popup 8

Loads the contact form entity.

Return value

\Drupal\contact\Entity\ContactForm|null The contact form configuration entity. NULL if the entity does not exist.

1 call to ContactPopupBlock::getContactForm()
ContactPopupBlock::blockAccess in src/Plugin/Block/ContactPopupBlock.php
Indicates whether the block should be shown.

File

src/Plugin/Block/ContactPopupBlock.php, line 226

Class

ContactPopupBlock
Provides a 'ContactPopupBlock' block.

Namespace

Drupal\contact_poup\Plugin\Block

Code

protected function getContactForm() {
  if (!isset($this->contactForm)) {
    if (isset($this->configuration['contact_form'])) {
      $this->contactForm = $this->entityTypeManager
        ->getStorage('contact_form')
        ->load($this->configuration['contact_form']);
    }
  }
  return $this->contactForm;
}