Path

ez components / documentation / api reference / 2007.2 / mail


Mail

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Source for file content_disposition_header.php

Documentation is available at content_disposition_header.php

  1. <?php
  2. /**
  3.  * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved.
  4.  * @license http://ez.no/licenses/new_bsd New BSD License
  5.  * @version 1.4
  6.  * @filesource
  7.  * @package Mail
  8.  */
  9.  
 10. /**
 11.  * A container to store a Content-Disposition header as described in http://www.faqs.org/rfcs/rfc2183.
 12.  *
 13.  * This container is used on the contentDisposition property on mail parts.
 14.  * Use it for reading and setting the Content-Disposition header.
 15.  *
 16.  * @package Mail
 17.  * @version 1.4
 18.  */
 19. class ezcMailContentDispositionHeader extends ezcBaseStruct
 20. {
 21.     /**
 22.      * The disposition type, either "inline" or "attachment".
 23.      *
 24.      * @var string 
 25.      */
 26.     public $disposition;
 27.  
 28.     /**
 29.      * The filename of the attachment.
 30.      *
 31.      * The filename should never include path information.
 32.      *
 33.      * @var string 
 34.      */
 35.     public $fileName;
 36.  
 37.     /**
 38.      * The language of the filename.
 39.      *
 40.      * @var string 
 41.      */
 42.     public $fileNameLanguage;
 43.  
 44.     /**
 45.      * The characterset of the file name.
 46.      *
 47.      * @var string 
 48.      */
 49.     public $fileNameCharSet;
 50.  
 51.     /**
 52.      * The creation date of the file attachment.
 53.      *
 54.      * The time should be formatted as specified by http://www.faqs.org/rfcs/rfc822.html
 55.      * section 5.
 56.      *
 57.      * A typical example is: Sun, 21 May 2006 16:00:50 +0400
 58.      *
 59.      * @var string 
 60.      */
 61.     public $creationDate;
 62.  
 63.     /**
 64.      * The last modification date of the file attachment.
 65.      *
 66.      * The time should be formatted as specified by http://www.faqs.org/rfcs/rfc822.html
 67.      * section 5.
 68.      *
 69.      * A typical example is: Sun, 21 May 2006 16:00:50 +0400
 70.      *
 71.      * @var string 
 72.      */
 73.     public $modificationDate;
 74.  
 75.     /**
 76.      * The last date the file attachment was read.
 77.      *
 78.      * The time should be formatted as specified by http://www.faqs.org/rfcs/rfc822.html
 79.      * section 5.
 80.      *
 81.      * A typical example is: Sun, 21 May 2006 16:00:50 +0400
 82.      *
 83.      * @var string 
 84.      */
 85.     public $readDate;
 86.  
 87.     /**
 88.      * The size of the content in bytes.
 89.      *
 90.      * @var int 
 91.      */
 92.     public $size;
 93.  
 94.     /**
 95.      * Any additional parameters provided in the Content-Disposition header.
 96.      *
 97.      * The format of the field is array(parameterName=>parameterValue)
 98.      *
 99.      * @var array(string=>string) 
100.      */
101.     public $additionalParameters = array();
102.  
103.     /**
104.      * Holds language and characterset data for the additional parameters.
105.      *
106.      * Format: array(parameterName=>array('charSet'=>string,'language'=>string))
107.      *
108.      * @apichange Merge this with $additionalParamters OR come up with an entirely new idea for the ContentDispositionHeader
109.      * @var array(string=>array()) 
110.      */
111.     public $additionalParametersMetaData = array();
112.  
113.     /**
114.      * Constructs a new ezcMailContentDispositionHeader holding the various values of this
115.      * container.
116.      *
117.      * @param string $disposition 
118.      * @param string $fileName 
119.      * @param string $creationDate 
120.      * @param string $modificationDate 
121.      * @param string $readDate 
122.      * @param string $size 
123.      * @param array(string=>string) $additionalParameters 
124.      * @param string $fileNameLanguage 
125.      * @param string $fileNameCharSet 
126.      */
127.     public function __construct$disposition 'inline',
128.                                  $fileName null,
129.                                  $creationDate null,
130.                                  $modificationDate null,
131.                                  $readDate null,
132.                                  $size null,
133.                                  $additionalParameters array(),
134.                                  $fileNameLanguage null,
135.                                  $fileNameCharSet null )
136.     {
137.         $this->disposition = $disposition;
138.         $this->fileName = $fileName;
139.         $this->fileNameLanguage = $fileNameLanguage;
140.         $this->fileNameCharSet = $fileNameCharSet;
141.         $this->creationDate = $creationDate;
142.         $this->modificationDate = $modificationDate;
143.         $this->readDate = $readDate;
144.         $this->size = $size;
145.         $this->additionalParameters = $additionalParameters;
146.     }
147.  
148.     /**
149.      * Returns a new instance of this class with the data specified by $array.
150.      *
151.      * $array contains all the data members of this class in the form:
152.      * array('member_name'=>value).
153.      *
154.      * __set_state makes this class exportable with var_export.
155.      * var_export() generates code, that calls this method when it
156.      * is parsed with PHP.
157.      *
158.      * @param array(string=>mixed) $array 
159.      * @return ezcMailAddress 
160.      */
161.     static public function __set_statearray $array )
162.     {
163.         return new ezcMailContentDispositionHeader$array['disposition'],
164.                                                     $array['fileName'],
165.                                                     $array['creationDate'],
166.                                                     $array['modificationDate'],
167.                                                     $array['readDate'],
168.                                                     $array['size'],
169.                                                     $array['additionalParameters'],
170.                                                     $array['fileNameLanguage'],
171.                                                     $array['fileNameCharSet']
172.                                                     );
173.     }
174. }
175.  
176. ?>
Last updated: Mon, 17 Dec 2007