You are here

public function EasyEmail::addAttachment in Easy Email 8

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

@inheritDoc

Overrides EasyEmailInterface::addAttachment

File

src/Entity/EasyEmail.php, line 688

Class

EasyEmail
Defines the Email entity.

Namespace

Drupal\easy_email\Entity

Code

public function addAttachment($fid) {
  if ($this
    ->hasField('attachment')) {
    return $this
      ->addEntityReferenceById($fid, 'attachment');
  }
  return $this;
}