|
@@ 219-231 (lines=13) @@
|
| 216 |
|
* @param boolean $allVersions Add all versions of the object to the folder if the repository supports |
| 217 |
|
* version-specific filing. Defaults to <code>true</code>. |
| 218 |
|
*/ |
| 219 |
|
public function addToFolder(ObjectIdInterface $folderId, $allVersions = true) |
| 220 |
|
{ |
| 221 |
|
$objectId = $this->getId(); |
| 222 |
|
$this->getBinding()->getMultiFilingService()->addObjectToFolder( |
| 223 |
|
$this->getRepositoryId(), |
| 224 |
|
$objectId, |
| 225 |
|
$folderId->getId(), |
| 226 |
|
$allVersions |
| 227 |
|
); |
| 228 |
|
|
| 229 |
|
// remove object form cache |
| 230 |
|
$this->getSession()->removeObjectFromCache($this->getSession()->createObjectId($objectId)); |
| 231 |
|
} |
| 232 |
|
|
| 233 |
|
/** |
| 234 |
|
* Removes this object from a folder. |
|
@@ 238-251 (lines=14) @@
|
| 235 |
|
* |
| 236 |
|
* @param ObjectIdInterface $folderId the object ID of the folder from which this object should be removed |
| 237 |
|
*/ |
| 238 |
|
public function removeFromFolder(ObjectIdInterface $folderId) |
| 239 |
|
{ |
| 240 |
|
$objectId = $this->getId(); |
| 241 |
|
|
| 242 |
|
$this->getBinding()->getMultiFilingService()->removeObjectFromFolder( |
| 243 |
|
$this->getRepositoryId(), |
| 244 |
|
$objectId, |
| 245 |
|
$folderId->getId(), |
| 246 |
|
null |
| 247 |
|
); |
| 248 |
|
|
| 249 |
|
// remove object form cache |
| 250 |
|
$this->getSession()->removeObjectFromCache($this->getSession()->createObjectId($objectId)); |
| 251 |
|
} |
| 252 |
|
|
| 253 |
|
/** |
| 254 |
|
* @param ObjectIdInterface|null $objectId |