1: <?php
2: /**
3: * Represents a reply for an iTip inviation.
4: *
5: * PHP version 5
6: *
7: * @category Kolab
8: * @package Kolab_Filter
9: * @author Gunnar Wrobel <wrobel@pardus.de>
10: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
11: * @link http://pear.horde.org/index.php?package=Kolab_Server
12: */
13:
14: /**
15: * Represents a reply for an iTip inviation.
16: *
17: * Copyright 2004-2010 Klarälvdalens Datakonsult AB
18: *
19: * See the enclosed file COPYING for license information (LGPL>=2.1). If you
20: * did not receive this file,
21: * see http://www.horde.org/licenses/lgpl21.
22: *
23: * @category Kolab
24: * @package Kolab_Filter
25: * @author Gunnar Wrobel <wrobel@pardus.de>
26: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
27: * @link http://pear.horde.org/index.php?package=Kolab_Server
28: */
29: class Horde_Kolab_Resource_Reply
30: {
31: /**
32: * Sender of the iTip reply.
33: *
34: * @var string
35: */
36: protected $_sender;
37:
38: /**
39: * Recipient of the iTip reply.
40: *
41: * @var string
42: */
43: protected $_recipient;
44:
45: /**
46: * Reply headers.
47: *
48: * @var MIME_Headers
49: */
50: protected $_headers;
51:
52: /**
53: * Reply body.
54: *
55: * @var MIME_Message
56: */
57: protected $_body;
58:
59: /**
60: * Constructor.
61: *
62: * @param string $sender Sender of the iTip reply.
63: * @param string $recipient Recipient of the iTip reply.
64: * @param MIME_Headers $headers Reply headers.
65: * @param MIME_Message $body Reply body.
66: */
67: public function __construct(
68: $sender, $recipient, MIME_Headers $headers, MIME_Message $body
69: ) {
70: $this->_sender = $sender;
71: $this->_recipient = MIME::encodeAddress($recipient);
72: $this->_headers = $headers;
73: $this->_body = $body;
74: }
75:
76: public function getSender()
77: {
78: return $this->_sender;
79: }
80:
81: public function getRecipient()
82: {
83: return $this->_recipient;
84: }
85:
86: public function getData()
87: {
88: return $this->_headers->toString() . '\r\n\r\n' . $this->_body->toString();
89: }
90: }