| @@ 32-50 (lines=19) @@ | ||
| 29 | * supports version-specific filing. Defaults to <code>true</code>. |
|
| 30 | * @param ExtensionDataInterface|null $extension |
|
| 31 | */ |
|
| 32 | public function addObjectToFolder( |
|
| 33 | $repositoryId, |
|
| 34 | $objectId, |
|
| 35 | $folderId, |
|
| 36 | $allVersions = true, |
|
| 37 | ExtensionDataInterface $extension = null |
|
| 38 | ) |
|
| 39 | { |
|
| 40 | $url = $this->getObjectUrl($repositoryId, $objectId); |
|
| 41 | ||
| 42 | $queryArray = [ |
|
| 43 | Constants::CONTROL_CMISACTION => Constants::CMISACTION_ADD_OBJECT_TO_FOLDER, |
|
| 44 | Constants::PARAM_SUCCINCT => $this->getSuccinct() ? 'true' : 'false', |
|
| 45 | Constants::PARAM_FOLDER_ID => $folderId, |
|
| 46 | Constants::PARAM_ALL_VERSIONS => $allVersions ? 'true' : 'false', |
|
| 47 | ]; |
|
| 48 | ||
| 49 | $this->post($url, $queryArray); |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * Removes an existing fileable non-folder object from a folder. |
|
| @@ 62-78 (lines=17) @@ | ||
| 59 | * currently filed. |
|
| 60 | * @param ExtensionDataInterface|null $extension |
|
| 61 | */ |
|
| 62 | public function removeObjectFromFolder( |
|
| 63 | $repositoryId, |
|
| 64 | $objectId, |
|
| 65 | $folderId = null, |
|
| 66 | ExtensionDataInterface $extension = null |
|
| 67 | ) |
|
| 68 | { |
|
| 69 | $url = $this->getObjectUrl($repositoryId, $objectId); |
|
| 70 | ||
| 71 | $queryArray = [ |
|
| 72 | Constants::CONTROL_CMISACTION => Constants::CMISACTION_REMOVE_OBJECT_FROM_FOLDER, |
|
| 73 | Constants::PARAM_SUCCINCT => $this->getSuccinct() ? 'true' : 'false', |
|
| 74 | Constants::PARAM_FOLDER_ID => $folderId, |
|
| 75 | ]; |
|
| 76 | ||
| 77 | $this->post($url, $queryArray); |
|
| 78 | } |
|
| 79 | } |
|
| 80 | ||
| @@ 477-493 (lines=17) @@ | ||
| 474 | * the document object specified (default is <code>true</code>) |
|
| 475 | * @param ExtensionDataInterface|null $extension |
|
| 476 | */ |
|
| 477 | public function deleteObject( |
|
| 478 | $repositoryId, |
|
| 479 | $objectId, |
|
| 480 | $allVersions = true, |
|
| 481 | ExtensionDataInterface $extension = null |
|
| 482 | ) { |
|
| 483 | $url = $this->getObjectUrl($repositoryId, $objectId); |
|
| 484 | $url->getQuery()->modify( |
|
| 485 | [ |
|
| 486 | Constants::CONTROL_CMISACTION => Constants::CMISACTION_DELETE, |
|
| 487 | Constants::PARAM_ALL_VERSIONS => $allVersions ? 'true' : 'false', |
|
| 488 | ] |
|
| 489 | ); |
|
| 490 | ||
| 491 | $this->post($url); |
|
| 492 | $this->flushCached(); |
|
| 493 | } |
|
| 494 | ||
| 495 | /** |
|
| 496 | * Deletes the specified folder object and all of its child- and descendant-objects. |
|