[ Index ]

MailPress 7.1

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

title

Body

[close]

/mp-includes/composer/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ -> UnstructuredHeader.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   * A Simple MIME Header.
  13   *
  14   * @author Chris Corbyn
  15   */
  16  class Swift_Mime_Headers_UnstructuredHeader extends Swift_Mime_Headers_AbstractHeader
  17  {
  18      /**
  19       * The value of this Header.
  20       *
  21       * @var string
  22       */
  23      private $value;
  24  
  25      /**
  26       * Creates a new SimpleHeader with $name.
  27       *
  28       * @param string $name
  29       */
  30      public function __construct($name, Swift_Mime_HeaderEncoder $encoder)
  31      {
  32          $this->setFieldName($name);
  33          $this->setEncoder($encoder);
  34      }
  35  
  36      /**
  37       * Get the type of Header that this instance represents.
  38       *
  39       * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX
  40       * @see TYPE_DATE, TYPE_ID, TYPE_PATH
  41       *
  42       * @return int
  43       */
  44      public function getFieldType()
  45      {
  46          return self::TYPE_TEXT;
  47      }
  48  
  49      /**
  50       * Set the model for the field body.
  51       *
  52       * This method takes a string for the field value.
  53       *
  54       * @param string $model
  55       */
  56      public function setFieldBodyModel($model)
  57      {
  58          $this->setValue($model);
  59      }
  60  
  61      /**
  62       * Get the model for the field body.
  63       *
  64       * This method returns a string.
  65       *
  66       * @return string
  67       */
  68      public function getFieldBodyModel()
  69      {
  70          return $this->getValue();
  71      }
  72  
  73      /**
  74       * Get the (unencoded) value of this header.
  75       *
  76       * @return string
  77       */
  78      public function getValue()
  79      {
  80          return $this->value;
  81      }
  82  
  83      /**
  84       * Set the (unencoded) value of this header.
  85       *
  86       * @param string $value
  87       */
  88      public function setValue($value)
  89      {
  90          $this->clearCachedValueIf($this->value != $value);
  91          $this->value = $value;
  92      }
  93  
  94      /**
  95       * Get the value of this header prepared for rendering.
  96       *
  97       * @return string
  98       */
  99      public function getFieldBody()
 100      {
 101          if (!$this->getCachedValue()) {
 102              $this->setCachedValue(
 103                  $this->encodeWords($this, $this->value)
 104                  );
 105          }
 106  
 107          return $this->getCachedValue();
 108      }
 109  }


Generated: Mon Mar 11 18:33:33 2019 Cross-referenced by PHPXref 0.7.1