1: <?php
2: /**
3: * The Horde_SyncMl_DataStore class describes one of the possible datastores
4: * (i.e. databases) of the device.
5: *
6: * Most important attributes are the preferred MIME Types for sending and
7: * receiving data for this datastore: $Tx_Pref and $Rx_Pref.
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_DataStore
19: {
20: /**
21: * The local URI of the datastore.
22: *
23: * @var string
24: */
25: public $SourceRef;
26:
27: /**
28: * The display name of the datastore
29: *
30: * @var string
31: */
32: public $DisplayName;
33:
34: /**
35: * The maximum size of a global unique identifier for the datastore in
36: * bytes.
37: *
38: * @var integer
39: */
40: public $MaxGUIDSize;
41:
42: /**
43: * The preferred types and versions of a content type received by the
44: * device.
45: *
46: * The content types (CTType) are the keys, the versions (VerCT) are the
47: * values.
48: *
49: * @var array
50: */
51: public $Rx_Pref = array();
52:
53: /**
54: * The supported types and versions of a content type received by the
55: * device.
56: *
57: * The content types (CTType) are the keys, the versions (VerCT) are the
58: * values.
59: *
60: * @var array
61: */
62: public $Rx = array();
63:
64: /**
65: * The preferred types and versions of a content type transmitted by the
66: * device.
67: *
68: * The content types (CTType) are the keys, the versions (VerCT) are the
69: * values.
70: *
71: * @var array
72: */
73: public $Tx_Pref = array();
74:
75: /**
76: * The supported types and versions of a content type transmitted by the
77: * device.
78: *
79: * The content types (CTType) are the keys, the versions (VerCT) are the
80: * values.
81: *
82: * @var array
83: */
84: public $Tx = array();
85:
86: /**
87: * The maximum memory and item identifier for the datastore.
88: *
89: * Not implemented yet.
90: */
91: public $DSMem;
92:
93: /**
94: * The synchronization capabilities of the datastore.
95: *
96: * The synchronization types (SyncType) are stored in the keys of the
97: * hash.
98: *
99: * @var array
100: */
101: public $SyncCap = array();
102:
103: /**
104: * Returns the preferred content type the client wants to receive.
105: *
106: * @return string The device's preferred content type or null if not
107: * specified (which is not allowed).
108: */
109: public function getPreferredRXContentType()
110: {
111: reset($this->Rx_Pref);
112: return key($this->Rx_Pref);
113: }
114:
115: /**
116: * Returns the version of the preferred content type the client wants to
117: * receive.
118: *
119: * @return string The device's preferred content type version or null if
120: * not specified (which is not allowed).
121: */
122: public function getPreferredRXContentTypeVersion()
123: {
124: return reset($this->Rx_Pref);
125: }
126: }
127: