[ Index ]

MailPress 544

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/Swiftmailer/classes/Swift/ -> Image.php (source)

   1  <?php
   2  
   3  /*
   4   * This file is part of SwiftMailer.
   5   * (c) 2004-2009 Chris Corbyn
   6   *
   7   * For the full copyright and license information, please view the LICENSE
   8   * file that was distributed with this source code.
   9   */
  10  
  11  /**
  12   * An image, embedded in a multipart message.
  13   *
  14   * @author Chris Corbyn
  15   */
  16  class Swift_Image extends Swift_EmbeddedFile
  17  {
  18      /**
  19       * Create a new EmbeddedFile.
  20       *
  21       * Details may be optionally provided to the constructor.
  22       *
  23       * @param string|Swift_OutputByteStream $data
  24       * @param string                        $filename
  25       * @param string                        $contentType
  26       */
  27      public function __construct($data = null, $filename = null, $contentType = null)
  28      {
  29          parent::__construct($data, $filename, $contentType);
  30      }
  31  
  32      /**
  33       * Create a new Image.
  34       *
  35       * @param string|Swift_OutputByteStream $data
  36       * @param string                        $filename
  37       * @param string                        $contentType
  38       *
  39       * @return Swift_Image
  40       */
  41      public static function newInstance($data = null, $filename = null, $contentType = null)
  42      {
  43          return new self($data, $filename, $contentType);
  44      }
  45  
  46      /**
  47       * Create a new Image from a filesystem path.
  48       *
  49       * @param string $path
  50       *
  51       * @return Swift_Image
  52       */
  53      public static function fromPath($path)
  54      {
  55          $image = self::newInstance()->setFile(
  56              new Swift_ByteStream_FileByteStream($path)
  57              );
  58  
  59          return $image;
  60      }
  61  }


Generated: Thu Apr 28 18:38:52 2016 Cross-referenced by PHPXref 0.7.1