|
@@ 251-261 (lines=11) @@
|
| 248 |
|
$this->repository->saveDocument($documentObject); |
| 249 |
|
} |
| 250 |
|
|
| 251 |
|
public function addDocument($postValues) |
| 252 |
|
{ |
| 253 |
|
$documentObject = $this->createDocumentFromPostValues($postValues); |
| 254 |
|
if ($postValues['path'] === '/') { |
| 255 |
|
$documentObject->path = $postValues['path'] . $documentObject->slug; |
| 256 |
|
} else { |
| 257 |
|
$documentObject->path = $postValues['path'] . '/' . $documentObject->slug; |
| 258 |
|
} |
| 259 |
|
|
| 260 |
|
$this->repository->saveDocument($documentObject); |
| 261 |
|
} |
| 262 |
|
|
| 263 |
|
public function deleteDocumentBySlug($slug) |
| 264 |
|
{ |
|
@@ 349-358 (lines=10) @@
|
| 346 |
|
* |
| 347 |
|
* @throws \Exception |
| 348 |
|
*/ |
| 349 |
|
public function addDocumentFolder($postValues) |
| 350 |
|
{ |
| 351 |
|
$documentFolderObject = $this->createDocumentFolderFromPostValues($postValues); |
| 352 |
|
if ($postValues['path'] === '/') { |
| 353 |
|
$documentFolderObject->path = $postValues['path'] . $documentFolderObject->slug; |
| 354 |
|
} else { |
| 355 |
|
$documentFolderObject->path = $postValues['path'] . '/' . $documentFolderObject->slug; |
| 356 |
|
} |
| 357 |
|
$this->repository->saveDocument($documentFolderObject); |
| 358 |
|
} |
| 359 |
|
|
| 360 |
|
/** |
| 361 |
|
* Delete a folder by its compound slug |