AcMailer\Options\MessageOptions::getAttachments PHP Method

getAttachments() public method

public getAttachments ( ) : AcMailer\Options\AttachmentsOptions
return AcMailer\Options\AttachmentsOptions
    public function getAttachments()
    {
        if (!isset($this->attachments)) {
            $this->setAttachments([]);
        }
        return $this->attachments;
    }

Usage Example

 public function testSetAttachments()
 {
     $expected = new AttachmentsOptions();
     $this->assertSame($this->messageOptions, $this->messageOptions->setAttachments($expected));
     $this->assertSame($expected, $this->messageOptions->getAttachments());
     $this->messageOptions->setAttachments([]);
     $this->assertInstanceOf('AcMailer\\Options\\AttachmentsOptions', $this->messageOptions->getAttachments());
 }