PageRenderTime 58ms CodeModel.GetById 26ms RepoModel.GetById 1ms app.codeStats 0ms

/framework/vendor/zend/Zend/Mail/Message/File.php

http://zoop.googlecode.com/
PHP | 96 lines | 26 code | 9 blank | 61 comment | 1 complexity | d3845bb82daa4e524077eacaf3f077f1 MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.1
  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. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. * @version $Id: File.php 20096 2010-01-06 02:05:09Z bkarwin $
  20. */
  21. /**
  22. * Zend_Mail_Part
  23. */
  24. require_once 'Zend/Mail/Part/File.php';
  25. /**
  26. * Zend_Mail_Message_Interface
  27. */
  28. require_once 'Zend/Mail/Message/Interface.php';
  29. /**
  30. * @category Zend
  31. * @package Zend_Mail
  32. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  33. * @license http://framework.zend.com/license/new-bsd New BSD License
  34. */
  35. class Zend_Mail_Message_File extends Zend_Mail_Part_File implements Zend_Mail_Message_Interface
  36. {
  37. /**
  38. * flags for this message
  39. * @var array
  40. */
  41. protected $_flags = array();
  42. /**
  43. * Public constructor
  44. *
  45. * In addition to the parameters of Zend_Mail_Part::__construct() this constructor supports:
  46. * - flags array with flags for message, keys are ignored, use constants defined in Zend_Mail_Storage
  47. *
  48. * @param string $rawMessage full message with or without headers
  49. * @throws Zend_Mail_Exception
  50. */
  51. public function __construct(array $params)
  52. {
  53. if (!empty($params['flags'])) {
  54. // set key and value to the same value for easy lookup
  55. $this->_flags = array_combine($params['flags'], $params['flags']);
  56. }
  57. parent::__construct($params);
  58. }
  59. /**
  60. * return toplines as found after headers
  61. *
  62. * @return string toplines
  63. */
  64. public function getTopLines()
  65. {
  66. return $this->_topLines;
  67. }
  68. /**
  69. * check if flag is set
  70. *
  71. * @param mixed $flag a flag name, use constants defined in Zend_Mail_Storage
  72. * @return bool true if set, otherwise false
  73. */
  74. public function hasFlag($flag)
  75. {
  76. return isset($this->_flags[$flag]);
  77. }
  78. /**
  79. * get all set flags
  80. *
  81. * @return array array with flags, key and value are the same for easy lookup
  82. */
  83. public function getFlags()
  84. {
  85. return $this->_flags;
  86. }
  87. }