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

LocationService::newLocationUpdateStruct()   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 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * LocationService 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\LocationService as LocationServiceInterface;
12
use eZ\Publish\API\Repository\Values\Content\Location;
13
use eZ\Publish\API\Repository\Values\Content\ContentInfo;
14
use eZ\Publish\API\Repository\Values\Content\LocationCreateStruct;
15
use eZ\Publish\API\Repository\Values\Content\LocationUpdateStruct;
16
17
/**
18
 * LocationService for SiteAccessAware layer.
19
 *
20
 * Currently does nothing but hand over calls to aggregated service.
21
 */
22
class LocationService implements LocationServiceInterface
23
{
24
    /**
25
     * Aggregated service.
26
     *
27
     * @var \eZ\Publish\API\Repository\LocationService
28
     */
29
    protected $service;
30
31
    /**
32
     * Construct service object from aggregated service.
33
     *
34
     * @param \eZ\Publish\API\Repository\LocationService $service
35
     */
36
    public function __construct(
37
        LocationServiceInterface $service
38
    ) {
39
        $this->service = $service;
40
    }
41
42
    public function copySubtree(Location $subtree, Location $targetParentLocation)
43
    {
44
        return $this->service->copySubtree($subtree, $targetParentLocation);
45
    }
46
47
    public function loadLocation($locationId)
48
    {
49
        return $this->service->loadLocation($locationId);
50
    }
51
52
    public function loadLocationByRemoteId($remoteId)
53
    {
54
        return $this->service->loadLocationByRemoteId($remoteId);
55
    }
56
57
    public function loadLocations(ContentInfo $contentInfo, Location $rootLocation = null)
58
    {
59
        return $this->service->loadLocations($contentInfo, $rootLocation);
60
    }
61
62
    public function loadLocationChildren(Location $location, $offset = 0, $limit = 25)
63
    {
64
        return $this->service->loadLocationChildren($location, $offset, $limit);
65
    }
66
67
    public function getLocationChildCount(Location $location)
68
    {
69
        return $this->service->getLocationChildCount($location);
70
    }
71
72
    public function createLocation(ContentInfo $contentInfo, LocationCreateStruct $locationCreateStruct)
73
    {
74
        return $this->service->createLocation($contentInfo, $locationCreateStruct);
75
    }
76
77
    public function updateLocation(Location $location, LocationUpdateStruct $locationUpdateStruct)
78
    {
79
        return $this->service->updateLocation($location, $locationUpdateStruct);
80
    }
81
82
    public function swapLocation(Location $location1, Location $location2)
83
    {
84
        return $this->service->swapLocation($location1, $location2);
85
    }
86
87
    public function hideLocation(Location $location)
88
    {
89
        return $this->service->hideLocation($location);
90
    }
91
92
    public function unhideLocation(Location $location)
93
    {
94
        return $this->service->unhideLocation($location);
95
    }
96
97
    public function moveSubtree(Location $location, Location $newParentLocation)
98
    {
99
        return $this->service->moveSubtree($location, $newParentLocation);
100
    }
101
102
    public function deleteLocation(Location $location)
103
    {
104
        $this->service->deleteLocation($location);
105
    }
106
107
    public function newLocationCreateStruct($parentLocationId)
108
    {
109
        return $this->service->newLocationCreateStruct($parentLocationId);
110
    }
111
112
    public function newLocationUpdateStruct()
113
    {
114
        return $this->service->newLocationUpdateStruct();
115
    }
116
}
117