You are here

public function WebformManagedFileBase::getTargetEntities in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/WebformManagedFileBase.php \Drupal\webform\Plugin\WebformElement\WebformManagedFileBase::getTargetEntities()

Get referenced entities.

Parameters

array $element: An element.

\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.

array $options: An array of options.

Return value

array An associative array containing entities keyed by entity_id.

Overrides WebformElementEntityReferenceInterface::getTargetEntities

2 calls to WebformManagedFileBase::getTargetEntities()
WebformImageFile::getEmailAttachments in src/Plugin/WebformElement/WebformImageFile.php
Get files as email attachments.
WebformManagedFileBase::getEmailAttachments in src/Plugin/WebformElement/WebformManagedFileBase.php
Get files as email attachments.

File

src/Plugin/WebformElement/WebformManagedFileBase.php, line 1427

Class

WebformManagedFileBase
Provides a base class webform 'managed_file' elements.

Namespace

Drupal\webform\Plugin\WebformElement

Code

public function getTargetEntities(array $element, WebformSubmissionInterface $webform_submission, array $options = []) {
  $value = $this
    ->getValue($element, $webform_submission, $options);
  if (empty($value)) {
    return NULL;
  }
  return $this
    ->getFiles($element, $value, $options);
}