1 | <?php |
||
12 | class DocumentStorage extends AbstractStorage |
||
13 | { |
||
14 | /** |
||
15 | * Get documents |
||
16 | * |
||
17 | * @param string $state |
||
18 | * |
||
19 | * @return array |
||
20 | * @throws \Exception |
||
21 | */ |
||
22 | public function getDocuments($state = 'published') |
||
29 | |||
30 | public function getDocumentsWithState($folderPath = '/') |
||
34 | |||
35 | /** |
||
36 | * @return int |
||
37 | */ |
||
38 | public function getTotalDocumentCount() |
||
42 | |||
43 | /** |
||
44 | * @param string $slug |
||
45 | * |
||
46 | * @param string $state |
||
47 | * |
||
48 | * @return mixed |
||
49 | * @throws \Exception |
||
50 | */ |
||
51 | public function getDocumentBySlug($slug, $state = 'published') |
||
60 | |||
61 | /** |
||
62 | * @param $postValues |
||
63 | * @param $state |
||
64 | * |
||
65 | * @return string path |
||
66 | * @throws \Exception |
||
67 | */ |
||
68 | public function saveDocument($postValues, $state = 'unpublished') |
||
86 | |||
87 | /** |
||
88 | * @param $postValues |
||
89 | * @param string $state |
||
90 | * @return string path |
||
91 | */ |
||
92 | public function addDocument($postValues, $state = 'unpublished') |
||
105 | |||
106 | /** |
||
107 | * @param $slug |
||
108 | */ |
||
109 | public function deleteDocumentBySlug($slug) |
||
114 | |||
115 | /** |
||
116 | * Returns the folder containing the document |
||
117 | * |
||
118 | * @param $path |
||
119 | * |
||
120 | * @return bool|\CloudControl\Cms\storage\Document |
||
121 | * @throws \Exception |
||
122 | */ |
||
123 | private function getDocumentContainerByPath($path) |
||
127 | |||
128 | public function getPublishedDocumentsNoFolders() |
||
132 | |||
133 | public function cleanPublishedDeletedDocuments() |
||
137 | |||
138 | /** |
||
139 | * Add new document in given path |
||
140 | * |
||
141 | * @param array $postValues |
||
142 | * |
||
143 | * @throws \Exception |
||
144 | */ |
||
145 | public function addDocumentFolder($postValues) |
||
156 | |||
157 | /** |
||
158 | * Delete a folder by its compound slug |
||
159 | * |
||
160 | * @param $slug |
||
161 | * |
||
162 | * @throws \Exception |
||
163 | */ |
||
164 | public function deleteDocumentFolderBySlug($slug) |
||
170 | |||
171 | /** |
||
172 | * @param string $slug |
||
173 | */ |
||
174 | public function publishDocumentBySlug($slug) |
||
179 | |||
180 | /** |
||
181 | * @param string $slug |
||
182 | */ |
||
183 | public function unpublishDocumentBySlug($slug) |
||
188 | |||
189 | /** |
||
190 | * Retrieve a folder by its compound slug |
||
191 | * |
||
192 | * @param $slug |
||
193 | * |
||
194 | * @return mixed |
||
195 | * @throws \Exception |
||
196 | */ |
||
197 | public function getDocumentFolderBySlug($slug) |
||
203 | |||
204 | } |