You are here

public function EasyEmail::addEvaluatedAttachment in Easy Email 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/EasyEmail.php \Drupal\easy_email\Entity\EasyEmail::addEvaluatedAttachment()

@inheritDoc

Overrides EasyEmailInterface::addEvaluatedAttachment

File

src/Entity/EasyEmail.php, line 766

Class

EasyEmail
Defines the Email entity.

Namespace

Drupal\easy_email\Entity

Code

public function addEvaluatedAttachment($attachment) {
  $existing_attachments = $this
    ->getEvaluatedAttachments();
  foreach ($existing_attachments as $existing_attachment) {
    if ($existing_attachment->uri === $attachment->uri) {
      return $this;
    }
  }
  $this->evaluatedAttachments[] = $attachment;
  return $this;
}