| @@ 328-345 (lines=18) @@ | ||
| 325 | * |
|
| 326 | * @return \eZ\Publish\API\Repository\Values\Content\TrashItem |
|
| 327 | */ |
|
| 328 | protected function buildDomainTrashItemObject(Trashed $spiTrashItem) |
|
| 329 | { |
|
| 330 | return new TrashItem( |
|
| 331 | array( |
|
| 332 | 'contentInfo' => $this->repository->getContentService()->loadContentInfo($spiTrashItem->contentId), |
|
| 333 | 'id' => $spiTrashItem->id, |
|
| 334 | 'priority' => $spiTrashItem->priority, |
|
| 335 | 'hidden' => $spiTrashItem->hidden, |
|
| 336 | 'invisible' => $spiTrashItem->invisible, |
|
| 337 | 'remoteId' => $spiTrashItem->remoteId, |
|
| 338 | 'parentLocationId' => $spiTrashItem->parentId, |
|
| 339 | 'pathString' => $spiTrashItem->pathString, |
|
| 340 | 'depth' => $spiTrashItem->depth, |
|
| 341 | 'sortField' => $spiTrashItem->sortField, |
|
| 342 | 'sortOrder' => $spiTrashItem->sortOrder, |
|
| 343 | ) |
|
| 344 | ); |
|
| 345 | } |
|
| 346 | ||
| 347 | /** |
|
| 348 | * @param int $timestamp |
|
| @@ 239-256 (lines=18) @@ | ||
| 236 | * |
|
| 237 | * @return \eZ\Publish\API\Repository\Values\Content\TrashItem |
|
| 238 | */ |
|
| 239 | protected function buildTrashItem(Location $location) |
|
| 240 | { |
|
| 241 | return new TrashItem( |
|
| 242 | array( |
|
| 243 | 'contentInfo' => $location->contentInfo, |
|
| 244 | 'id' => $location->id, |
|
| 245 | 'priority' => $location->priority, |
|
| 246 | 'hidden' => $location->hidden, |
|
| 247 | 'invisible' => $location->invisible, |
|
| 248 | 'remoteId' => $location->remoteId, |
|
| 249 | 'parentLocationId' => $location->parentLocationId, |
|
| 250 | 'pathString' => $location->pathString, |
|
| 251 | 'depth' => (int)$location->depth, |
|
| 252 | 'sortField' => $location->sortField, |
|
| 253 | 'sortOrder' => $location->sortOrder, |
|
| 254 | ) |
|
| 255 | ); |
|
| 256 | } |
|
| 257 | } |
|
| 258 | ||
| @@ 436-453 (lines=18) @@ | ||
| 433 | return $this->mapLocation($spiLocation, $contentInfo); |
|
| 434 | } |
|
| 435 | ||
| 436 | private function mapLocation(SPILocation $spiLocation, ContentInfo $contentInfo) : APILocation |
|
| 437 | { |
|
| 438 | return new Location( |
|
| 439 | array( |
|
| 440 | 'contentInfo' => $contentInfo, |
|
| 441 | 'id' => $spiLocation->id, |
|
| 442 | 'priority' => $spiLocation->priority, |
|
| 443 | 'hidden' => $spiLocation->hidden, |
|
| 444 | 'invisible' => $spiLocation->invisible, |
|
| 445 | 'remoteId' => $spiLocation->remoteId, |
|
| 446 | 'parentLocationId' => $spiLocation->parentId, |
|
| 447 | 'pathString' => $spiLocation->pathString, |
|
| 448 | 'depth' => $spiLocation->depth, |
|
| 449 | 'sortField' => $spiLocation->sortField, |
|
| 450 | 'sortOrder' => $spiLocation->sortOrder, |
|
| 451 | ) |
|
| 452 | ); |
|
| 453 | } |
|
| 454 | ||
| 455 | /** |
|
| 456 | * Build API Location and corresponding ContentInfo domain objects and apply to LocationSearchResult. |
|