1: <?php
2: /**
3: * The class Horde_SyncMl_Command_SyncElement stores information from the
4: * <Add>, <Delete> and <Replace> elements found inside a <Sync> command.
5: *
6: * Instances of this class are created during the XML parsing by
7: * Horde_SyncMl_Command_Sync.
8: *
9: * Copyright 2005-2012 Horde LLC (http://www.horde.org/)
10: *
11: * See the enclosed file COPYING for license information (LGPL). If you
12: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
13: *
14: * @author Karsten Fourmont <karsten@horde.org>
15: * @author Jan Schneider <jan@horde.org>
16: * @package SyncMl
17: */
18: class Horde_SyncMl_SyncElement
19: {
20: /**
21: * The MIME content type of the sync command.
22: *
23: * @var string
24: */
25: public $contentType;
26:
27: /**
28: * Encoding format of the content as specified in the <Meta><Format>
29: * element, like 'b64'.
30: *
31: * @var string
32: */
33: public $contentFormat;
34:
35: /**
36: * The actual data content of the sync command.
37: *
38: * @var string $content
39: */
40: public $content = '';
41:
42: /**
43: * The size of the data item of the sync command in bytes as specified by
44: * a <Size> element.
45: *
46: * @var integer
47: */
48: public $size;
49:
50: /**
51: * The command ID (<CmdID>) of the sync command.
52: *
53: * @var integer
54: */
55: public $cmdID;
56:
57: /**
58: * Name of the sync command, like 'Add'.
59: *
60: * @var string
61: */
62: public $elementType;
63:
64: /**
65: * The client ID for the data item processed in the sync command.
66: *
67: * @var string
68: */
69: public $cuid;
70:
71: /**
72: * The code to be sent as status response in a <Status> element, one of
73: * the Horde_SyncMl::RESPONSE_* constants.
74: *
75: * This is set in Horde_SyncMl_Sync::handleClientSyncItem() when "processing"
76: * the item.
77: *
78: * @var integer
79: */
80: public $responseCode;
81:
82: /**
83: * The Sync object for this element is part of.
84: *
85: * @var object Horde_SyncMl_Sync
86: */
87: public $sync;
88:
89: /**
90: * Constructor.
91: *
92: * @param Horde_SyncMl_Sync $sync
93: * @param string $elementType
94: * @param integer $cmdID
95: * @param integer $size
96: */
97: public function __construct($sync, $elementType, $cmdID, $size)
98: {
99: $this->sync = $sync;
100: $this->elementType = $elementType;
101: $this->cmdID = $cmdID;
102: $this->size = $size;
103: }
104: }
105: