You are here

interface WebformElementAttachmentInterface in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElementAttachmentInterface.php \Drupal\webform\Plugin\WebformElementAttachmentInterface

Defines the interface for webform elements can provide email attachments.

Hierarchy

Expanded class hierarchy of WebformElementAttachmentInterface

All classes that implement WebformElementAttachmentInterface

5 files declare their use of WebformElementAttachmentInterface
Webform.php in src/Entity/Webform.php
WebformAttachmentBase.php in modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentBase.php
WebformCompositeBase.php in src/Plugin/WebformElement/WebformCompositeBase.php
WebformManagedFileBase.php in src/Plugin/WebformElement/WebformManagedFileBase.php
WebformSubmissionViewBuilder.php in src/WebformSubmissionViewBuilder.php

File

src/Plugin/WebformElementAttachmentInterface.php, line 10

Namespace

Drupal\webform\Plugin
View source
interface WebformElementAttachmentInterface {

  /**
   * Get files as email attachments.
   *
   * This is also used to export attachments.
   *
   * @param array $element
   *   An element.
   * @param \Drupal\webform\WebformSubmissionInterface $webform_submission
   *   A webform submission.
   * @param array $options
   *   An array of options.
   *
   * @return array
   *   An array containing email attachments which include an attachments
   *   'filename', 'filemime', 'filepath', and 'filecontent'.
   *
   * @see \Drupal\webform\Plugin\WebformHandler\EmailWebformHandler::getMessageAttachments
   * @see \Drupal\mimemail\Utility\MimeMailFormatHelper::mimeMailHtmlBody
   * @see \Drupal\smtp\Plugin\Mail\SMTPMailSystem::mail
   * @see \Drupal\swiftmailer\Plugin\Mail\SwiftMailer::attachAsMimeMail
   */
  public function getEmailAttachments(array $element, WebformSubmissionInterface $webform_submission, array $options = []);

  /**
   * Get files as export attachments.
   *
   * This is also used to export attachments.
   *
   * @param array $element
   *   An element.
   * @param \Drupal\webform\WebformSubmissionInterface $webform_submission
   *   A webform submission.
   * @param array $options
   *   An array of options.
   *
   * @return array
   *   An array containing email attachments which include an attachments
   *   'filename', 'filemime', 'filepath', and 'filecontent'.
   *
   * @see \Drupal\webform\WebformSubmissionExporter::writeRecords
   */
  public function getExportAttachments(array $element, WebformSubmissionInterface $webform_submission, array $options = []);

  /**
   * Determine if the element type has export attachments.
   *
   * @return boolearn
   *   TRUE if the element type has export attachments.
   */
  public function hasExportAttachments();

  /**
   * Get attachment export batch limit.
   *
   * @return int|NULL
   *   Batch limit or NULL if the batch limit should not be overidden.
   */
  public function getExportAttachmentsBatchLimit();

}

Members

Namesort descending Modifiers Type Description Overrides
WebformElementAttachmentInterface::getEmailAttachments public function Get files as email attachments. 3
WebformElementAttachmentInterface::getExportAttachments public function Get files as export attachments. 3
WebformElementAttachmentInterface::getExportAttachmentsBatchLimit public function Get attachment export batch limit. 3
WebformElementAttachmentInterface::hasExportAttachments public function Determine if the element type has export attachments. 3