Interface.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /**
  23. * @category Zend
  24. * @package Zend_Mail
  25. * @subpackage Storage
  26. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  27. * @license http://framework.zend.com/license/new-bsd New BSD License
  28. */
  29. interface Zend_Mail_Storage_Writable_Interface
  30. {
  31. /**
  32. * create a new folder
  33. *
  34. * This method also creates parent folders if necessary. Some mail storages may restrict, which folder
  35. * may be used as parent or which chars may be used in the folder name
  36. *
  37. * @param string $name global name of folder, local name if $parentFolder is set
  38. * @param string|Zend_Mail_Storage_Folder $parentFolder parent folder for new folder, else root folder is parent
  39. * @return null
  40. * @throws Zend_Mail_Storage_Exception
  41. */
  42. public function createFolder($name, $parentFolder = null);
  43. /**
  44. * remove a folder
  45. *
  46. * @param string|Zend_Mail_Storage_Folder $name name or instance of folder
  47. * @return null
  48. * @throws Zend_Mail_Storage_Exception
  49. */
  50. public function removeFolder($name);
  51. /**
  52. * rename and/or move folder
  53. *
  54. * The new name has the same restrictions as in createFolder()
  55. *
  56. * @param string|Zend_Mail_Storage_Folder $oldName name or instance of folder
  57. * @param string $newName new global name of folder
  58. * @return null
  59. * @throws Zend_Mail_Storage_Exception
  60. */
  61. public function renameFolder($oldName, $newName);
  62. /**
  63. * append a new message to mail storage
  64. *
  65. * @param string|Zend_Mail_Message|Zend_Mime_Message $message message as string or instance of message class
  66. * @param null|string|Zend_Mail_Storage_Folder $folder folder for new message, else current folder is taken
  67. * @param null|array $flags set flags for new message, else a default set is used
  68. * @throws Zend_Mail_Storage_Exception
  69. */
  70. public function appendMessage($message, $folder = null, $flags = null);
  71. /**
  72. * copy an existing message
  73. *
  74. * @param int $id number of message
  75. * @param string|Zend_Mail_Storage_Folder $folder name or instance of targer folder
  76. * @return null
  77. * @throws Zend_Mail_Storage_Exception
  78. */
  79. public function copyMessage($id, $folder);
  80. /**
  81. * move an existing message
  82. *
  83. * @param int $id number of message
  84. * @param string|Zend_Mail_Storage_Folder $folder name or instance of targer folder
  85. * @return null
  86. * @throws Zend_Mail_Storage_Exception
  87. */
  88. public function moveMessage($id, $folder);
  89. /**
  90. * set flags for message
  91. *
  92. * NOTE: this method can't set the recent flag.
  93. *
  94. * @param int $id number of message
  95. * @param array $flags new flags for message
  96. * @throws Zend_Mail_Storage_Exception
  97. */
  98. public function setFlags($id, $flags);
  99. }