[ Index ]

MailPress 544

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

title

Body

[close]

/mp-includes/Swiftmailer/classes/Swift/Mime/Headers/ -> OpenDKIMHeader.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 OpenDKIM Specific Header using only raw header datas without encoding.
  13   *
  14   * @author De Cock Xavier <xdecock@gmail.com>
  15   */
  16  class Swift_Mime_Headers_OpenDKIMHeader implements Swift_Mime_Header
  17  {
  18      /**
  19       * The value of this Header.
  20       *
  21       * @var string
  22       */
  23      private $_value;
  24  
  25      /**
  26       * The name of this Header.
  27       *
  28       * @var string
  29       */
  30      private $_fieldName;
  31  
  32      /**
  33       * Creates a new SimpleHeader with $name.
  34       *
  35       * @param string                   $name
  36       * @param Swift_Mime_HeaderEncoder $encoder
  37       * @param Swift_Mime_Grammar       $grammar
  38       */
  39      public function __construct($name)
  40      {
  41          $this->_fieldName = $name;
  42      }
  43  
  44      /**
  45       * Get the type of Header that this instance represents.
  46       *
  47       * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX
  48       * @see TYPE_DATE, TYPE_ID, TYPE_PATH
  49       *
  50       * @return int
  51       */
  52      public function getFieldType()
  53      {
  54          return self::TYPE_TEXT;
  55      }
  56  
  57      /**
  58       * Set the model for the field body.
  59       *
  60       * This method takes a string for the field value.
  61       *
  62       * @param string $model
  63       */
  64      public function setFieldBodyModel($model)
  65      {
  66          $this->setValue($model);
  67      }
  68  
  69      /**
  70       * Get the model for the field body.
  71       *
  72       * This method returns a string.
  73       *
  74       * @return string
  75       */
  76      public function getFieldBodyModel()
  77      {
  78          return $this->getValue();
  79      }
  80  
  81      /**
  82       * Get the (unencoded) value of this header.
  83       *
  84       * @return string
  85       */
  86      public function getValue()
  87      {
  88          return $this->_value;
  89      }
  90  
  91      /**
  92       * Set the (unencoded) value of this header.
  93       *
  94       * @param string $value
  95       */
  96      public function setValue($value)
  97      {
  98          $this->_value = $value;
  99      }
 100  
 101      /**
 102       * Get the value of this header prepared for rendering.
 103       *
 104       * @return string
 105       */
 106      public function getFieldBody()
 107      {
 108          return $this->_value;
 109      }
 110  
 111      /**
 112       * Get this Header rendered as a RFC 2822 compliant string.
 113       *
 114       * @return string
 115       */
 116      public function toString()
 117      {
 118          return $this->_fieldName.': '.$this->_value;
 119      }
 120  
 121      /**
 122       * Set the Header FieldName.
 123       *
 124       * @see Swift_Mime_Header::getFieldName()
 125       */
 126      public function getFieldName()
 127      {
 128          return $this->_fieldName;
 129      }
 130  
 131      /**
 132       * Ignored.
 133       */
 134      public function setCharset($charset)
 135      {
 136      }
 137  }


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