Completed
Push — master ( 4e0ac6...0fdc9b )
by Łukasz
25:36
created

TrashService::emptyTrash()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * TrashService class.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
namespace eZ\Publish\Core\Repository\SiteAccessAware;
10
11
use eZ\Publish\API\Repository\TrashService as TrashServiceInterface;
12
use eZ\Publish\API\Repository\Values\Content\TrashItem;
13
use eZ\Publish\API\Repository\Values\Content\Location;
14
use eZ\Publish\API\Repository\Values\Content\Query;
15
16
/**
17
 * TrashService for SiteAccessAware layer.
18
 *
19
 * Currently does nothing but hand over calls to aggregated service.
20
 */
21
class TrashService implements TrashServiceInterface
22
{
23
    /** @var \eZ\Publish\API\Repository\TrashService */
24
    protected $service;
25
26
    /**
27
     * Construct service object from aggregated service.
28
     *
29
     * @param \eZ\Publish\API\Repository\TrashService $service
30
     */
31
    public function __construct(
32
        TrashServiceInterface $service
33
    ) {
34
        $this->service = $service;
35
    }
36
37
    public function loadTrashItem($trashItemId)
38
    {
39
        return $this->service->loadTrashItem($trashItemId);
40
    }
41
42
    public function trash(Location $location)
43
    {
44
        return $this->service->trash($location);
45
    }
46
47
    public function recover(TrashItem $trashItem, Location $newParentLocation = null)
48
    {
49
        return $this->service->recover($trashItem, $newParentLocation);
50
    }
51
52
    public function emptyTrash()
53
    {
54
        return $this->service->emptyTrash();
55
    }
56
57
    public function deleteTrashItem(TrashItem $trashItem)
58
    {
59
        return $this->service->deleteTrashItem($trashItem);
60
    }
61
62
    public function findTrashItems(Query $query)
63
    {
64
        return $this->service->findTrashItems($query);
65
    }
66
}
67