EmbeddedFile.php 1.2KB

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