1: <?php
2: /**
3: * Interface for server queries.
4: *
5: * PHP version 5
6: *
7: * @category Kolab
8: * @package Kolab_Server
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: * Interface for server queries.
16: *
17: * Copyright 2008-2012 Horde LLC (http://www.horde.org/)
18: *
19: * See the enclosed file COPYING for license information (LGPL). If you
20: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
21: *
22: * @category Kolab
23: * @package Kolab_Server
24: * @author Gunnar Wrobel <wrobel@pardus.de>
25: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
26: * @link http://pear.horde.org/index.php?package=Kolab_Server
27: */
28: interface Horde_Kolab_Server_Query_Interface
29: {
30: /**
31: * Return the query as a string.
32: *
33: * @return string The query in string format.
34: */
35: public function __toString();
36:
37: /**
38: * Convert the equals element to query format.
39: *
40: * @param Horde_Kolab_Server_Query_Element_Single $single The element to convert.
41: *
42: * @return mixed The query element in query format.
43: */
44: public function convertEquals(Horde_Kolab_Server_Query_Element_Equals $equals);
45:
46: /**
47: * Convert the begins element to query format.
48: *
49: * @param Horde_Kolab_Server_Query_Element_Single $single The element to convert.
50: *
51: * @return mixed The query element in query format.
52: */
53: public function convertBegins(Horde_Kolab_Server_Query_Element_Begins $begins);
54:
55: /**
56: * Convert the ends element to query format.
57: *
58: * @param Horde_Kolab_Server_Query_Element_Single $single The element to convert.
59: *
60: * @return mixed The query element in query format.
61: */
62: public function convertEnds(Horde_Kolab_Server_Query_Element_Ends $ends);
63:
64: /**
65: * Convert the contains element to query format.
66: *
67: * @param Horde_Kolab_Server_Query_Element_Single $single The element to convert.
68: *
69: * @return mixed The query element in query format.
70: */
71: public function convertContains(Horde_Kolab_Server_Query_Element_Contains $contains);
72:
73: /**
74: * Convert the less element to query format.
75: *
76: * @param Horde_Kolab_Server_Query_Element_Single $single The element to convert.
77: *
78: * @return mixed The query element in query format.
79: */
80: public function convertLess(Horde_Kolab_Server_Query_Element_Less $less);
81:
82: /**
83: * Convert the greater element to query format.
84: *
85: * @param Horde_Kolab_Server_Query_Element_Single $single The element to convert.
86: *
87: * @return mixed The query element in query format.
88: */
89: public function convertGreater(Horde_Kolab_Server_Query_Element_Greater $greater);
90:
91: /**
92: * Convert the approx element to query format.
93: *
94: * @param Horde_Kolab_Server_Query_Element_Single $single The element to convert.
95: *
96: * @return mixed The query element in query format.
97: */
98: public function convertApprox(Horde_Kolab_Server_Query_Element_Approx $approx);
99:
100: /**
101: * Convert the not element to query format.
102: *
103: * @param Horde_Kolab_Server_Query_Element_Group $group The element to convert.
104: *
105: * @return mixed The query element in query format.
106: */
107: public function convertNot(Horde_Kolab_Server_Query_Element_Not $not);
108:
109: /**
110: * Convert the and element to query format.
111: *
112: * @param Horde_Kolab_Server_Query_Element_Group $group The element to convert.
113: *
114: * @return mixed The query element in query format.
115: */
116: public function convertAnd(Horde_Kolab_Server_Query_Element_And $and);
117:
118: /**
119: * Convert the or element to query format.
120: *
121: * @param Horde_Kolab_Server_Query_Element_Group $group The element to convert.
122: *
123: * @return mixed The query element in query format.
124: */
125: public function convertOr(Horde_Kolab_Server_Query_Element_Group $or);
126: }