|
@@ 159-169 (lines=11) @@
|
| 156 |
|
$this->repository->saveDocument($documentObject); |
| 157 |
|
} |
| 158 |
|
|
| 159 |
|
public function addDocument($postValues) |
| 160 |
|
{ |
| 161 |
|
$documentObject = DocumentFactory::createDocumentFromPostValues($postValues, $this); |
| 162 |
|
if ($postValues['path'] === '/') { |
| 163 |
|
$documentObject->path = $postValues['path'] . $documentObject->slug; |
| 164 |
|
} else { |
| 165 |
|
$documentObject->path = $postValues['path'] . '/' . $documentObject->slug; |
| 166 |
|
} |
| 167 |
|
|
| 168 |
|
$this->repository->saveDocument($documentObject); |
| 169 |
|
} |
| 170 |
|
|
| 171 |
|
public function deleteDocumentBySlug($slug) |
| 172 |
|
{ |
|
@@ 184-193 (lines=10) @@
|
| 181 |
|
* |
| 182 |
|
* @throws \Exception |
| 183 |
|
*/ |
| 184 |
|
public function addDocumentFolder($postValues) |
| 185 |
|
{ |
| 186 |
|
$documentFolderObject = DocumentFolderFactory::createDocumentFolderFromPostValues($postValues); |
| 187 |
|
if ($postValues['path'] === '/') { |
| 188 |
|
$documentFolderObject->path = $postValues['path'] . $documentFolderObject->slug; |
| 189 |
|
} else { |
| 190 |
|
$documentFolderObject->path = $postValues['path'] . '/' . $documentFolderObject->slug; |
| 191 |
|
} |
| 192 |
|
$this->repository->saveDocument($documentFolderObject); |
| 193 |
|
} |
| 194 |
|
|
| 195 |
|
/** |
| 196 |
|
* Delete a folder by its compound slug |