EmbeddedFile.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /*
  3. * This file is part of SwiftMailer.
  4. * (c) 2004-2009 Chris Corbyn
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. /**
  10. * An embedded file, in a multipart message.
  11. *
  12. * @author Chris Corbyn
  13. */
  14. class Swift_Mime_EmbeddedFile extends Swift_Mime_Attachment
  15. {
  16. /**
  17. * Creates a new Attachment with $headers and $encoder.
  18. *
  19. * @param array $mimeTypes optional
  20. */
  21. public function __construct(Swift_Mime_SimpleHeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_IdGenerator $idGenerator, $mimeTypes = [])
  22. {
  23. parent::__construct($headers, $encoder, $cache, $idGenerator, $mimeTypes);
  24. $this->setDisposition('inline');
  25. $this->setId($this->getId());
  26. }
  27. /**
  28. * Get the nesting level of this EmbeddedFile.
  29. *
  30. * Returns {@see LEVEL_RELATED}.
  31. *
  32. * @return int
  33. */
  34. public function getNestingLevel()
  35. {
  36. return self::LEVEL_RELATED;
  37. }
  38. }