|
@@ 332-355 (lines=24) @@
|
| 329 |
|
* @return DocumentInterface|null the updated document, or <code>null</code> if the repository did not return |
| 330 |
|
* an object ID |
| 331 |
|
*/ |
| 332 |
|
public function deleteContentStream($refresh = true) |
| 333 |
|
{ |
| 334 |
|
$newObjectId = $this->getId(); |
| 335 |
|
$changeToken = $this->getPropertyValue(PropertyIds::CHANGE_TOKEN); |
| 336 |
|
|
| 337 |
|
$this->getBinding()->getObjectService()->deleteContentStream( |
| 338 |
|
$this->getRepositoryId(), |
| 339 |
|
$newObjectId, |
| 340 |
|
$changeToken |
| 341 |
|
); |
| 342 |
|
|
| 343 |
|
if ($refresh === true) { |
| 344 |
|
$this->refresh(); |
| 345 |
|
} |
| 346 |
|
|
| 347 |
|
if ($newObjectId === null) { |
| 348 |
|
return null; |
| 349 |
|
} |
| 350 |
|
|
| 351 |
|
return $this->getSession()->getObject( |
| 352 |
|
$this->getSession()->createObjectId($newObjectId), |
| 353 |
|
$this->getCreationContext() |
| 354 |
|
); |
| 355 |
|
} |
| 356 |
|
|
| 357 |
|
/** |
| 358 |
|
* Fetches all versions of this document using the given OperationContext. |
|
@@ 463-485 (lines=23) @@
|
| 460 |
|
* @return ObjectIdInterface|null the updated object ID, or <code>null</code> if the repository did not return |
| 461 |
|
* an object ID |
| 462 |
|
*/ |
| 463 |
|
public function setContentStream(StreamInterface $contentStream, $overwrite, $refresh = true) |
| 464 |
|
{ |
| 465 |
|
$newObjectId = $this->getId(); |
| 466 |
|
$changeToken = $this->getPropertyValue(PropertyIds::CHANGE_TOKEN); |
| 467 |
|
|
| 468 |
|
$this->getBinding()->getObjectService()->setContentStream( |
| 469 |
|
$this->getRepositoryId(), |
| 470 |
|
$newObjectId, |
| 471 |
|
$this->getObjectFactory()->convertContentStream($contentStream), |
| 472 |
|
$overwrite, |
| 473 |
|
$changeToken |
| 474 |
|
); |
| 475 |
|
|
| 476 |
|
if ($refresh === true) { |
| 477 |
|
$this->refresh(); |
| 478 |
|
} |
| 479 |
|
|
| 480 |
|
if ($newObjectId === null) { |
| 481 |
|
return null; |
| 482 |
|
} |
| 483 |
|
|
| 484 |
|
return $this->getSession()->createObjectId($newObjectId); |
| 485 |
|
} |
| 486 |
|
|
| 487 |
|
/** |
| 488 |
|
* Returns the checkin comment (CMIS property cmis:checkinComment). |