TYPO3  7.6
UnstructuredHeader.php
Go to the documentation of this file.
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 
17 {
23  private $_value;
24 
32  public function __construct($name, Swift_Mime_HeaderEncoder $encoder, Swift_Mime_Grammar $grammar)
33  {
34  $this->setFieldName($name);
35  $this->setEncoder($encoder);
36  parent::__construct($grammar);
37  }
38 
47  public function getFieldType()
48  {
49  return self::TYPE_TEXT;
50  }
51 
59  public function setFieldBodyModel($model)
60  {
61  $this->setValue($model);
62  }
63 
71  public function getFieldBodyModel()
72  {
73  return $this->getValue();
74  }
75 
81  public function getValue()
82  {
83  return $this->_value;
84  }
85 
91  public function setValue($value)
92  {
93  $this->clearCachedValueIf($this->_value != $value);
94  $this->_value = $value;
95  }
96 
102  public function getFieldBody()
103  {
104  if (!$this->getCachedValue()) {
105  $this->setCachedValue(
106  $this->encodeWords($this, $this->_value)
107  );
108  }
109 
110  return $this->getCachedValue();
111  }
112 }