123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <?php
-
-
-
-
-
-
- class Swift_Mime_Headers_DateHeader extends Swift_Mime_Headers_AbstractHeader
- {
-
-
-
- private $_timestamp;
-
-
-
- public function __construct($name, Swift_Mime_Grammar $grammar)
- {
- $this->setFieldName($name);
- parent::__construct($grammar);
- }
-
-
-
- public function getFieldType()
- {
- return self::TYPE_DATE;
- }
-
-
-
- public function setFieldBodyModel($model)
- {
- $this->setTimestamp($model);
- }
-
-
-
- public function getFieldBodyModel()
- {
- return $this->getTimestamp();
- }
-
-
-
- public function getTimestamp()
- {
- return $this->_timestamp;
- }
-
-
-
- public function setTimestamp($timestamp)
- {
- if (!is_null($timestamp))
- {
- $timestamp = (int) $timestamp;
- }
- $this->clearCachedValueIf($this->_timestamp != $timestamp);
- $this->_timestamp = $timestamp;
- }
-
-
-
- public function getFieldBody()
- {
- if (!$this->getCachedValue())
- {
- if (isset($this->_timestamp))
- {
- $this->setCachedValue(date('r', $this->_timestamp));
- }
- }
- return $this->getCachedValue();
- }
-
- }
|