Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Mail / Header / Date.php
blob2f2cae88d82fc60d516fbcf930e0f56dff4f0ffd
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Mail\Header;
12 /**
13 * @todo Add accessors for setting date from DateTime, Zend\Date, or a string
15 class Date implements HeaderInterface
17 /**
18 * @var string
20 protected $value;
22 public static function fromString($headerLine)
24 list($name, $value) = GenericHeader::splitHeaderLine($headerLine);
26 // check to ensure proper header type for this factory
27 if (strtolower($name) !== 'date') {
28 throw new Exception\InvalidArgumentException('Invalid header line for Date string');
31 $header = new static($value);
33 return $header;
36 public function __construct($value)
38 $this->value = $value;
41 public function getFieldName()
43 return 'Date';
46 public function getFieldValue($format = HeaderInterface::FORMAT_RAW)
48 return $this->value;
51 public function setEncoding($encoding)
53 // This header must be always in US-ASCII
54 return $this;
57 public function getEncoding()
59 return 'ASCII';
62 public function toString()
64 return 'Date: ' . $this->getFieldValue();