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

URLWildcardService::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * URLWildcardService 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\URLWildcardService as URLWildcardServiceInterface;
12
use eZ\Publish\API\Repository\Values\Content\URLWildcard;
13
14
/**
15
 * URLWildcardService for SiteAccessAware layer.
16
 *
17
 * Currently does nothing but hand over calls to aggregated service.
18
 */
19
class URLWildcardService implements URLWildcardServiceInterface
20
{
21
    /**
22
     * Aggregated service.
23
     *
24
     * @var \eZ\Publish\API\Repository\URLWildcardService
25
     */
26
    protected $service;
27
28
    /**
29
     * Construct service object from aggregated service.
30
     *
31
     * @param \eZ\Publish\API\Repository\URLWildcardService $service
32
     */
33
    public function __construct(
34
        URLWildcardServiceInterface $service
35
    ) {
36
        $this->service = $service;
37
    }
38
39
    public function create($sourceUrl, $destinationUrl, $forward = false)
40
    {
41
        return $this->service->create($sourceUrl, $destinationUrl, $forward);
42
    }
43
44
    public function remove(URLWildcard $urlWildcard)
45
    {
46
        return $this->service->remove($urlWildcard);
47
    }
48
49
    public function load($id)
50
    {
51
        return $this->service->load($id);
52
    }
53
54
    public function loadAll($offset = 0, $limit = -1)
55
    {
56
        return $this->service->loadAll($offset, $limit);
57
    }
58
59
    public function translate($url)
60
    {
61
        return $this->service->translate($url);
62
    }
63
}
64