|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* @copyright Copyright (C) eZ Systems AS. All rights reserved. |
|
5
|
|
|
* @license For full copyright and license information view LICENSE file distributed with this source code. |
|
6
|
|
|
*/ |
|
7
|
|
|
namespace eZ\Publish\Core\SignalSlot; |
|
8
|
|
|
|
|
9
|
|
|
use eZ\Publish\API\Repository\URLService as URLServiceInterface; |
|
10
|
|
|
use eZ\Publish\API\Repository\Values\URL\URL; |
|
11
|
|
|
use eZ\Publish\API\Repository\Values\URL\URLQuery; |
|
12
|
|
|
use eZ\Publish\API\Repository\Values\URL\URLUpdateStruct; |
|
13
|
|
|
use eZ\Publish\Core\SignalSlot\Signal\URLService\UpdateUrlSignal; |
|
14
|
|
|
|
|
15
|
|
|
class URLService implements URLServiceInterface |
|
16
|
|
|
{ |
|
17
|
|
|
/** |
|
18
|
|
|
* Aggregated service. |
|
19
|
|
|
* |
|
20
|
|
|
* @var \eZ\Publish\API\Repository\URLService |
|
21
|
|
|
*/ |
|
22
|
|
|
protected $service; |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* SignalDispatcher. |
|
26
|
|
|
* |
|
27
|
|
|
* @var SignalDispatcher |
|
28
|
|
|
*/ |
|
29
|
|
|
protected $signalDispatcher; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* URLService constructor. |
|
33
|
|
|
* |
|
34
|
|
|
* @param \eZ\Publish\API\Repository\URLService $service |
|
35
|
|
|
* @param \eZ\Publish\Core\SignalSlot\SignalDispatcher $signalDispatcher |
|
36
|
|
|
*/ |
|
37
|
|
|
public function __construct(URLServiceInterface $service, SignalDispatcher $signalDispatcher) |
|
38
|
|
|
{ |
|
39
|
|
|
$this->service = $service; |
|
40
|
|
|
$this->signalDispatcher = $signalDispatcher; |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* {@inheritdoc} |
|
45
|
|
|
*/ |
|
46
|
|
|
public function createUpdateStruct() |
|
47
|
|
|
{ |
|
48
|
|
|
return $this->service->createUpdateStruct(); |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* {@inheritdoc} |
|
53
|
|
|
*/ |
|
54
|
|
|
public function findUrls(URLQuery $query) |
|
55
|
|
|
{ |
|
56
|
|
|
return $this->service->findUrls($query); |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* {@inheritdoc} |
|
61
|
|
|
*/ |
|
62
|
|
|
public function findUsages(URL $url, $offset = 0, $limit = -1) |
|
63
|
|
|
{ |
|
64
|
|
|
return $this->service->findUsages($url, $offset, $limit); |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
/** |
|
68
|
|
|
* {@inheritdoc} |
|
69
|
|
|
*/ |
|
70
|
|
|
public function loadById($id) |
|
71
|
|
|
{ |
|
72
|
|
|
return $this->service->loadById($id); |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* {@inheritdoc} |
|
77
|
|
|
*/ |
|
78
|
|
|
public function loadByUrl($url) |
|
79
|
|
|
{ |
|
80
|
|
|
return $this->service->loadByUrl($url); |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
/** |
|
84
|
|
|
* {@inheritdoc} |
|
85
|
|
|
*/ |
|
86
|
|
|
public function updateUrl(URL $url, URLUpdateStruct $struct) |
|
87
|
|
|
{ |
|
88
|
|
|
$returnValue = $this->service->updateUrl($url, $struct); |
|
89
|
|
|
|
|
90
|
|
|
$this->signalDispatcher->emit( |
|
91
|
|
|
new UpdateUrlSignal([ |
|
92
|
|
|
'urlId' => $returnValue->id, |
|
|
|
|
|
|
93
|
|
|
]) |
|
94
|
|
|
); |
|
95
|
|
|
|
|
96
|
|
|
return $returnValue; |
|
97
|
|
|
} |
|
98
|
|
|
} |
|
99
|
|
|
|
Since your code implements the magic setter
_set, this function will be called for any write access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.