1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Repository 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\Repository as RepositoryInterface; |
12
|
|
|
use eZ\Publish\API\Repository\Values\ValueObject; |
13
|
|
|
use eZ\Publish\API\Repository\Values\User\UserReference; |
14
|
|
|
use Closure; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Repository class. |
18
|
|
|
*/ |
19
|
|
|
class Repository implements RepositoryInterface |
20
|
|
|
{ |
21
|
|
|
/** @var \eZ\Publish\API\Repository\Repository */ |
22
|
|
|
protected $repository; |
23
|
|
|
|
24
|
|
|
/** @var \eZ\Publish\API\Repository\ContentService */ |
25
|
|
|
protected $contentService; |
26
|
|
|
|
27
|
|
|
/** @var \eZ\Publish\API\Repository\SectionService */ |
28
|
|
|
protected $sectionService; |
29
|
|
|
|
30
|
|
|
/** @var \eZ\Publish\API\Repository\SearchService */ |
31
|
|
|
protected $searchService; |
32
|
|
|
|
33
|
|
|
/** @var \eZ\Publish\API\Repository\UserService */ |
34
|
|
|
protected $userService; |
35
|
|
|
|
36
|
|
|
/** @var \eZ\Publish\API\Repository\LanguageService */ |
37
|
|
|
protected $languageService; |
38
|
|
|
|
39
|
|
|
/** @var \eZ\Publish\API\Repository\LocationService */ |
40
|
|
|
protected $locationService; |
41
|
|
|
|
42
|
|
|
/** @var \eZ\Publish\API\Repository\TrashService */ |
43
|
|
|
protected $trashService; |
44
|
|
|
|
45
|
|
|
/** @var \eZ\Publish\API\Repository\ContentTypeService */ |
46
|
|
|
protected $contentTypeService; |
47
|
|
|
|
48
|
|
|
/** @var \eZ\Publish\API\Repository\ObjectStateService */ |
49
|
|
|
protected $objectStateService; |
50
|
|
|
|
51
|
|
|
/** @var \eZ\Publish\API\Repository\URLAliasService */ |
52
|
|
|
protected $urlAliasService; |
53
|
|
|
|
54
|
|
|
/** @var \eZ\Publish\Core\Repository\NotificationService */ |
55
|
|
|
protected $notificationService; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* Construct repository object from aggregated repository. |
59
|
|
|
*/ |
60
|
|
|
public function __construct( |
61
|
|
|
RepositoryInterface $repository, |
62
|
|
|
ContentService $contentService, |
63
|
|
|
ContentTypeService $contentTypeService, |
64
|
|
|
ObjectStateService $objectStateService, |
65
|
|
|
URLAliasService $urlAliasService, |
66
|
|
|
UserService $userService, |
67
|
|
|
SearchService $searchService, |
68
|
|
|
SectionService $sectionService, |
69
|
|
|
TrashService $trashService, |
70
|
|
|
LocationService $locationService, |
71
|
|
|
LanguageService $languageService, |
72
|
|
|
NotificationService $notificationService |
73
|
|
|
) { |
74
|
|
|
$this->repository = $repository; |
75
|
|
|
$this->contentService = $contentService; |
76
|
|
|
$this->contentTypeService = $contentTypeService; |
77
|
|
|
$this->objectStateService = $objectStateService; |
78
|
|
|
$this->urlAliasService = $urlAliasService; |
79
|
|
|
$this->userService = $userService; |
80
|
|
|
$this->searchService = $searchService; |
81
|
|
|
$this->sectionService = $sectionService; |
82
|
|
|
$this->trashService = $trashService; |
83
|
|
|
$this->locationService = $locationService; |
84
|
|
|
$this->languageService = $languageService; |
85
|
|
|
$this->notificationService = $notificationService; |
|
|
|
|
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
public function getCurrentUser() |
89
|
|
|
{ |
90
|
|
|
return $this->repository->getCurrentUser(); |
|
|
|
|
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
public function getCurrentUserReference() |
94
|
|
|
{ |
95
|
|
|
return $this->repository->getCurrentUserReference(); |
|
|
|
|
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
public function setCurrentUser(UserReference $user) |
99
|
|
|
{ |
100
|
|
|
return $this->repository->setCurrentUser($user); |
|
|
|
|
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
public function sudo(Closure $callback) |
104
|
|
|
{ |
105
|
|
|
return $this->repository->sudo($callback, $this); |
|
|
|
|
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
public function hasAccess($module, $function, UserReference $user = null) |
109
|
|
|
{ |
110
|
|
|
return $this->repository->hasAccess($module, $function, $user); |
|
|
|
|
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
public function canUser($module, $function, ValueObject $object, $targets = null) |
114
|
|
|
{ |
115
|
|
|
return $this->repository->canUser($module, $function, $object, $targets); |
|
|
|
|
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
public function getContentService() |
119
|
|
|
{ |
120
|
|
|
return $this->contentService; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
public function getContentLanguageService() |
124
|
|
|
{ |
125
|
|
|
return $this->languageService; |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
public function getContentTypeService() |
129
|
|
|
{ |
130
|
|
|
return $this->contentTypeService; |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
public function getLocationService() |
134
|
|
|
{ |
135
|
|
|
return $this->locationService; |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
public function getTrashService() |
139
|
|
|
{ |
140
|
|
|
return $this->trashService; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
public function getSectionService() |
144
|
|
|
{ |
145
|
|
|
return $this->sectionService; |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
public function getUserService() |
149
|
|
|
{ |
150
|
|
|
return $this->userService; |
151
|
|
|
} |
152
|
|
|
|
153
|
|
|
public function getURLAliasService() |
154
|
|
|
{ |
155
|
|
|
return $this->urlAliasService; |
156
|
|
|
} |
157
|
|
|
|
158
|
|
|
public function getURLWildcardService() |
159
|
|
|
{ |
160
|
|
|
return $this->repository->getURLWildcardService(); |
161
|
|
|
} |
162
|
|
|
|
163
|
|
|
public function getObjectStateService() |
164
|
|
|
{ |
165
|
|
|
return $this->objectStateService; |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
public function getRoleService() |
169
|
|
|
{ |
170
|
|
|
return $this->repository->getRoleService(); |
171
|
|
|
} |
172
|
|
|
|
173
|
|
|
public function getSearchService() |
174
|
|
|
{ |
175
|
|
|
return $this->searchService; |
176
|
|
|
} |
177
|
|
|
|
178
|
|
|
public function getFieldTypeService() |
179
|
|
|
{ |
180
|
|
|
return $this->repository->getFieldTypeService(); |
181
|
|
|
} |
182
|
|
|
|
183
|
|
|
public function getPermissionResolver() |
184
|
|
|
{ |
185
|
|
|
return $this->repository->getPermissionResolver(); |
186
|
|
|
} |
187
|
|
|
|
188
|
|
|
public function getURLService() |
189
|
|
|
{ |
190
|
|
|
return $this->repository->getURLService(); |
191
|
|
|
} |
192
|
|
|
|
193
|
|
|
public function getBookmarkService() |
194
|
|
|
{ |
195
|
|
|
return $this->repository->getBookmarkService(); |
196
|
|
|
} |
197
|
|
|
|
198
|
|
|
public function getNotificationService() |
199
|
|
|
{ |
200
|
|
|
return $this->repository->getNotificationService(); |
201
|
|
|
} |
202
|
|
|
|
203
|
|
|
public function beginTransaction() |
204
|
|
|
{ |
205
|
|
|
return $this->repository->beginTransaction(); |
206
|
|
|
} |
207
|
|
|
|
208
|
|
|
public function commit() |
209
|
|
|
{ |
210
|
|
|
return $this->repository->commit(); |
211
|
|
|
} |
212
|
|
|
|
213
|
|
|
public function rollback() |
214
|
|
|
{ |
215
|
|
|
return $this->repository->rollback(); |
216
|
|
|
} |
217
|
|
|
} |
218
|
|
|
|
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..