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

TrashService   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 50
rs 10
c 0
b 0
f 0
wmc 7
lcom 1
cbo 1

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A loadTrashItem() 0 4 1
A trash() 0 4 1
A recover() 0 4 1
A emptyTrash() 0 4 1
A deleteTrashItem() 0 4 1
A findTrashItems() 0 4 1
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