|
1 <?php |
|
2 /** |
|
3 * LICENSE |
|
4 * |
|
5 * This source file is subject to the new BSD license that is bundled |
|
6 * with this package in the file LICENSE.txt. |
|
7 * It is also available through the world-wide-web at this URL: |
|
8 * http://framework.zend.com/license/new-bsd |
|
9 * If you did not receive a copy of the license and are unable to |
|
10 * obtain it through the world-wide-web, please send an email |
|
11 * to license@zend.com so we can send you a copy immediately. |
|
12 * |
|
13 * @category Zend |
|
14 * @package Zend_Cloud |
|
15 * @subpackage DocumentService |
|
16 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
|
17 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
18 */ |
|
19 |
|
20 require_once 'Zend/Cloud/DocumentService/Adapter.php'; |
|
21 require_once 'Zend/Cloud/DocumentService/Document.php'; |
|
22 require_once 'Zend/Cloud/DocumentService/DocumentSet.php'; |
|
23 require_once 'Zend/Cloud/DocumentService/Query.php'; |
|
24 |
|
25 /** |
|
26 * Abstract document service adapter |
|
27 * |
|
28 * Provides functionality surrounding setting classes for each of: |
|
29 * - document objects |
|
30 * - document set objects |
|
31 * - query class objects |
|
32 * |
|
33 * @category Zend |
|
34 * @package Zend_Cloud |
|
35 * @subpackage DocumentService |
|
36 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
|
37 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
38 */ |
|
39 abstract class Zend_Cloud_DocumentService_Adapter_AbstractAdapter |
|
40 implements Zend_Cloud_DocumentService_Adapter |
|
41 { |
|
42 const DOCUMENT_CLASS = 'document_class'; |
|
43 const DOCUMENTSET_CLASS = 'documentset_class'; |
|
44 const QUERY_CLASS = 'query_class'; |
|
45 |
|
46 /** |
|
47 * Class to utilize for new document objects |
|
48 * @var string |
|
49 */ |
|
50 protected $_documentClass = 'Zend_Cloud_DocumentService_Document'; |
|
51 |
|
52 /** |
|
53 * Class to utilize for new document set objects |
|
54 * @var string |
|
55 */ |
|
56 protected $_documentSetClass = 'Zend_Cloud_DocumentService_DocumentSet'; |
|
57 |
|
58 /** |
|
59 * Class to utilize for new query objects |
|
60 * |
|
61 * @var string |
|
62 */ |
|
63 protected $_queryClass = 'Zend_Cloud_DocumentService_Query'; |
|
64 |
|
65 /** |
|
66 * Set the class for document objects |
|
67 * |
|
68 * @param string $class |
|
69 * @return Zend_Cloud_DocumentService_Adapter_AbstractAdapter |
|
70 */ |
|
71 public function setDocumentClass($class) |
|
72 { |
|
73 $this->_documentClass = (string) $class; |
|
74 return $this; |
|
75 } |
|
76 |
|
77 /** |
|
78 * Get the class for document objects |
|
79 * |
|
80 * @return string |
|
81 */ |
|
82 public function getDocumentClass() |
|
83 { |
|
84 return $this->_documentClass; |
|
85 } |
|
86 |
|
87 /** |
|
88 * Set the class for document set objects |
|
89 * |
|
90 * @param string $class |
|
91 * @return Zend_Cloud_DocumentService_Adapter_AbstractAdapter |
|
92 */ |
|
93 public function setDocumentSetClass($class) |
|
94 { |
|
95 $this->_documentSetClass = (string) $class; |
|
96 return $this; |
|
97 } |
|
98 |
|
99 /** |
|
100 * Get the class for document set objects |
|
101 * |
|
102 * @return string |
|
103 */ |
|
104 public function getDocumentSetClass() |
|
105 { |
|
106 return $this->_documentSetClass; |
|
107 } |
|
108 |
|
109 /** |
|
110 * Set the query class for query objects |
|
111 * |
|
112 * @param string $class |
|
113 * @return Zend_Cloud_DocumentService_Adapter_AbstractAdapter |
|
114 */ |
|
115 public function setQueryClass($class) |
|
116 { |
|
117 $this->_queryClass = (string) $class; |
|
118 return $this; |
|
119 } |
|
120 |
|
121 /** |
|
122 * Get the class for query objects |
|
123 * |
|
124 * @return string |
|
125 */ |
|
126 public function getQueryClass() |
|
127 { |
|
128 return $this->_queryClass; |
|
129 } |
|
130 } |