EmbeddedFile.php 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. * @package Swift
  13. * @subpackage Mime
  14. * @author Chris Corbyn
  15. */
  16. class Swift_Mime_EmbeddedFile extends Swift_Mime_Attachment
  17. {
  18. /**
  19. * Creates a new Attachment with $headers and $encoder.
  20. *
  21. * @param Swift_Mime_HeaderSet $headers
  22. * @param Swift_Mime_ContentEncoder $encoder
  23. * @param Swift_KeyCache $cache
  24. * @param Swift_Mime_Grammar $grammar
  25. * @param array $mimeTypes optional
  26. */
  27. public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_Mime_Grammar $grammar, $mimeTypes = array())
  28. {
  29. parent::__construct($headers, $encoder, $cache, $grammar, $mimeTypes);
  30. $this->setDisposition('inline');
  31. $this->setId($this->getId());
  32. }
  33. /**
  34. * Get the nesting level of this EmbeddedFile.
  35. *
  36. * Returns {@see LEVEL_RELATED}.
  37. *
  38. * @return integer
  39. */
  40. public function getNestingLevel()
  41. {
  42. return self::LEVEL_RELATED;
  43. }
  44. }