Completed
Push — siteaccessaware-layer-only ( 14ffb6 )
by André
15:43
created

TrashService::recover()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
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
    /**
24
     * Aggregated service.
25
     *
26
     * @var \eZ\Publish\API\Repository\TrashService
27
     */
28
    protected $service;
29
30
    /**
31
     * Construct service object from aggregated service.
32
     *
33
     * @param \eZ\Publish\API\Repository\TrashService $service
34
     */
35
    public function __construct(
36
        TrashServiceInterface $service
37
    ) {
38
        $this->service = $service;
39
    }
40
41
    public function loadTrashItem($trashItemId)
42
    {
43
        return $this->service->loadTrashItem($trashItemId);
44
    }
45
46
    public function trash(Location $location)
47
    {
48
        return $this->service->trash($location);
49
    }
50
51
    public function recover(TrashItem $trashItem, Location $newParentLocation = null)
52
    {
53
        return $this->service->recover($trashItem, $newParentLocation);
54
    }
55
56
    public function emptyTrash()
57
    {
58
        return $this->service->emptyTrash();
59
    }
60
61
    public function deleteTrashItem(TrashItem $trashItem)
62
    {
63
        return $this->service->deleteTrashItem($trashItem);
64
    }
65
66
    public function findTrashItems(Query $query)
67
    {
68
        return $this->service->findTrashItems($query);
69
    }
70
}
71