Beispiel #1
0
 /**
  * Returns a list of all trash items.
  *
  * @return \eZ\Publish\Core\REST\Server\Values\Trash
  */
 public function loadTrashItems(Request $request)
 {
     $offset = $request->query->has('offset') ? (int) $request->query->get('offset') : 0;
     $limit = $request->query->has('limit') ? (int) $request->query->get('limit') : -1;
     $query = new Query();
     $query->offset = $offset >= 0 ? $offset : null;
     $query->limit = $limit >= 0 ? $limit : null;
     $trashItems = array();
     foreach ($this->trashService->findTrashItems($query)->items as $trashItem) {
         $trashItems[] = new Values\RestTrashItem($trashItem, $this->locationService->getLocationChildCount($trashItem));
     }
     return new Values\Trash($trashItems, $request->getPathInfo());
 }
 /**
  * Returns a collection of Trashed locations contained in the trash.
  *
  * $query allows to filter/sort the elements to be contained in the collection.
  *
  * @param \eZ\Publish\API\Repository\Values\Content\Query $query
  *
  * @return \eZ\Publish\API\Repository\Values\Content\SearchResult
  */
 public function findTrashItems(Query $query)
 {
     return $this->service->findTrashItems($query);
 }