Interface.php
137 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Zend Framework |
| 4 | * |
| 5 | * LICENSE |
| 6 | * |
| 7 | * This source file is subject to the new BSD license that is bundled |
| 8 | * with this package in the file LICENSE.txt. |
| 9 | * It is also available through the world-wide-web at this URL: |
| 10 | * http://framework.zend.com/license/new-bsd |
| 11 | * If you did not receive a copy of the license and are unable to |
| 12 | * obtain it through the world-wide-web, please send an email |
| 13 | * to license@zend.com so we can send you a copy immediately. |
| 14 | * |
| 15 | * @category Zend |
| 16 | * @package Zend_Mail |
| 17 | * @subpackage Storage |
| 18 | * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) |
| 19 | * @license http://framework.zend.com/license/new-bsd New BSD License |
| 20 | * @version $Id: Interface.php 23775 2011-03-01 17:25:24Z ralph $ |
| 21 | */ |
| 22 | |
| 23 | |
| 24 | /** |
| 25 | * @category Zend |
| 26 | * @package Zend_Mail |
| 27 | * @subpackage Storage |
| 28 | * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) |
| 29 | * @license http://framework.zend.com/license/new-bsd New BSD License |
| 30 | */ |
| 31 | |
| 32 | interface Zend_Mail_Part_Interface extends RecursiveIterator |
| 33 | { |
| 34 | /** |
| 35 | * Check if part is a multipart message |
| 36 | * |
| 37 | * @return bool if part is multipart |
| 38 | */ |
| 39 | public function isMultipart(); |
| 40 | |
| 41 | |
| 42 | /** |
| 43 | * Body of part |
| 44 | * |
| 45 | * If part is multipart the raw content of this part with all sub parts is returned |
| 46 | * |
| 47 | * @return string body |
| 48 | * @throws Zend_Mail_Exception |
| 49 | */ |
| 50 | public function getContent(); |
| 51 | |
| 52 | /** |
| 53 | * Return size of part |
| 54 | * |
| 55 | * @return int size |
| 56 | */ |
| 57 | public function getSize(); |
| 58 | |
| 59 | /** |
| 60 | * Get part of multipart message |
| 61 | * |
| 62 | * @param int $num number of part starting with 1 for first part |
| 63 | * @return Zend_Mail_Part wanted part |
| 64 | * @throws Zend_Mail_Exception |
| 65 | */ |
| 66 | public function getPart($num); |
| 67 | |
| 68 | /** |
| 69 | * Count parts of a multipart part |
| 70 | * |
| 71 | * @return int number of sub-parts |
| 72 | */ |
| 73 | public function countParts(); |
| 74 | |
| 75 | |
| 76 | /** |
| 77 | * Get all headers |
| 78 | * |
| 79 | * The returned headers are as saved internally. All names are lowercased. The value is a string or an array |
| 80 | * if a header with the same name occurs more than once. |
| 81 | * |
| 82 | * @return array headers as array(name => value) |
| 83 | */ |
| 84 | public function getHeaders(); |
| 85 | |
| 86 | /** |
| 87 | * Get a header in specificed format |
| 88 | * |
| 89 | * Internally headers that occur more than once are saved as array, all other as string. If $format |
| 90 | * is set to string implode is used to concat the values (with Zend_Mime::LINEEND as delim). |
| 91 | * |
| 92 | * @param string $name name of header, matches case-insensitive, but camel-case is replaced with dashes |
| 93 | * @param string $format change type of return value to 'string' or 'array' |
| 94 | * @return string|array value of header in wanted or internal format |
| 95 | * @throws Zend_Mail_Exception |
| 96 | */ |
| 97 | public function getHeader($name, $format = null); |
| 98 | |
| 99 | /** |
| 100 | * Get a specific field from a header like content type or all fields as array |
| 101 | * |
| 102 | * If the header occurs more than once, only the value from the first header |
| 103 | * is returned. |
| 104 | * |
| 105 | * Throws a Zend_Mail_Exception if the requested header does not exist. If |
| 106 | * the specific header field does not exist, returns null. |
| 107 | * |
| 108 | * @param string $name name of header, like in getHeader() |
| 109 | * @param string $wantedPart the wanted part, default is first, if null an array with all parts is returned |
| 110 | * @param string $firstName key name for the first part |
| 111 | * @return string|array wanted part or all parts as array($firstName => firstPart, partname => value) |
| 112 | * @throws Zend_Exception, Zend_Mail_Exception |
| 113 | */ |
| 114 | public function getHeaderField($name, $wantedPart = 0, $firstName = 0); |
| 115 | |
| 116 | |
| 117 | /** |
| 118 | * Getter for mail headers - name is matched in lowercase |
| 119 | * |
| 120 | * This getter is short for Zend_Mail_Part::getHeader($name, 'string') |
| 121 | * |
| 122 | * @see Zend_Mail_Part::getHeader() |
| 123 | * |
| 124 | * @param string $name header name |
| 125 | * @return string value of header |
| 126 | * @throws Zend_Mail_Exception |
| 127 | */ |
| 128 | public function __get($name); |
| 129 | |
| 130 | /** |
| 131 | * magic method to get content of part |
| 132 | * |
| 133 | * @return string content |
| 134 | */ |
| 135 | public function __toString(); |
| 136 | } |
| 137 |