|
@@ 35-47 (lines=13) @@
|
| 32 |
|
* @param ExtensionDataInterface|null $extension |
| 33 |
|
* @return TypeDefinitionInterface |
| 34 |
|
*/ |
| 35 |
|
public function createType($repositoryId, TypeDefinitionInterface $type, ExtensionDataInterface $extension = null) |
| 36 |
|
{ |
| 37 |
|
$url = $this->getRepositoryUrl($repositoryId); |
| 38 |
|
|
| 39 |
|
$url->getQuery()->modify( |
| 40 |
|
[ |
| 41 |
|
Constants::CONTROL_CMISACTION => Constants::CMISACTION_CREATE_TYPE, |
| 42 |
|
Constants::CONTROL_TYPE => $this->getJsonConverter()->convertFromTypeDefinition($type) |
| 43 |
|
] |
| 44 |
|
); |
| 45 |
|
|
| 46 |
|
return $this->getJsonConverter()->convertTypeDefinition($this->postJson($url)); |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
/** |
| 50 |
|
* Deletes a type. |
|
@@ 231-243 (lines=13) @@
|
| 228 |
|
* @param ExtensionDataInterface|null $extension |
| 229 |
|
* @return TypeDefinitionInterface the updated type |
| 230 |
|
*/ |
| 231 |
|
public function updateType($repositoryId, TypeDefinitionInterface $type, ExtensionDataInterface $extension = null) |
| 232 |
|
{ |
| 233 |
|
$url = $this->getRepositoryUrl($repositoryId); |
| 234 |
|
|
| 235 |
|
$url->getQuery()->modify( |
| 236 |
|
[ |
| 237 |
|
Constants::CONTROL_CMISACTION => Constants::CMISACTION_UPDATE_TYPE, |
| 238 |
|
Constants::CONTROL_TYPE => json_encode($this->getJsonConverter()->convertFromTypeDefinition($type)) |
| 239 |
|
] |
| 240 |
|
); |
| 241 |
|
|
| 242 |
|
return $this->getJsonConverter()->convertTypeDefinition($this->postJson($url)); |
| 243 |
|
} |
| 244 |
|
} |
| 245 |
|
|