|
@@ 153-163 (lines=11) @@
|
| 150 |
|
$this->repository->saveDocument($documentObject); |
| 151 |
|
} |
| 152 |
|
|
| 153 |
|
public function addDocument($postValues) |
| 154 |
|
{ |
| 155 |
|
$documentObject = DocumentFactory::createDocumentFromPostValues($postValues, $this); |
| 156 |
|
if ($postValues['path'] === '/') { |
| 157 |
|
$documentObject->path = $postValues['path'] . $documentObject->slug; |
| 158 |
|
} else { |
| 159 |
|
$documentObject->path = $postValues['path'] . '/' . $documentObject->slug; |
| 160 |
|
} |
| 161 |
|
|
| 162 |
|
$this->repository->saveDocument($documentObject); |
| 163 |
|
} |
| 164 |
|
|
| 165 |
|
public function deleteDocumentBySlug($slug) |
| 166 |
|
{ |
|
@@ 178-187 (lines=10) @@
|
| 175 |
|
* |
| 176 |
|
* @throws \Exception |
| 177 |
|
*/ |
| 178 |
|
public function addDocumentFolder($postValues) |
| 179 |
|
{ |
| 180 |
|
$documentFolderObject = DocumentFolderFactory::createDocumentFolderFromPostValues($postValues); |
| 181 |
|
if ($postValues['path'] === '/') { |
| 182 |
|
$documentFolderObject->path = $postValues['path'] . $documentFolderObject->slug; |
| 183 |
|
} else { |
| 184 |
|
$documentFolderObject->path = $postValues['path'] . '/' . $documentFolderObject->slug; |
| 185 |
|
} |
| 186 |
|
$this->repository->saveDocument($documentFolderObject); |
| 187 |
|
} |
| 188 |
|
|
| 189 |
|
/** |
| 190 |
|
* Delete a folder by its compound slug |