|
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
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* Repository class. |
|
17
|
|
|
*/ |
|
18
|
|
|
class Repository implements RepositoryInterface |
|
19
|
|
|
{ |
|
20
|
|
|
/** @var \eZ\Publish\API\Repository\Repository */ |
|
21
|
|
|
protected $repository; |
|
22
|
|
|
|
|
23
|
|
|
/** @var \eZ\Publish\API\Repository\ContentService */ |
|
24
|
|
|
protected $contentService; |
|
25
|
|
|
|
|
26
|
|
|
/** @var \eZ\Publish\API\Repository\SectionService */ |
|
27
|
|
|
protected $sectionService; |
|
28
|
|
|
|
|
29
|
|
|
/** @var \eZ\Publish\API\Repository\RoleService */ |
|
30
|
|
|
protected $roleService; |
|
31
|
|
|
|
|
32
|
|
|
/** @var \eZ\Publish\API\Repository\SearchService */ |
|
33
|
|
|
protected $searchService; |
|
34
|
|
|
|
|
35
|
|
|
/** @var \eZ\Publish\API\Repository\UserService */ |
|
36
|
|
|
protected $userService; |
|
37
|
|
|
|
|
38
|
|
|
/** @var \eZ\Publish\API\Repository\LanguageService */ |
|
39
|
|
|
protected $languageService; |
|
40
|
|
|
|
|
41
|
|
|
/** @var \eZ\Publish\API\Repository\LocationService */ |
|
42
|
|
|
protected $locationService; |
|
43
|
|
|
|
|
44
|
|
|
/** @var \eZ\Publish\API\Repository\TrashService */ |
|
45
|
|
|
protected $trashService; |
|
46
|
|
|
|
|
47
|
|
|
/** @var \eZ\Publish\API\Repository\ContentTypeService */ |
|
48
|
|
|
protected $contentTypeService; |
|
49
|
|
|
|
|
50
|
|
|
/** @var \eZ\Publish\API\Repository\ObjectStateService */ |
|
51
|
|
|
protected $objectStateService; |
|
52
|
|
|
|
|
53
|
|
|
/** @var \eZ\Publish\API\Repository\URLAliasService */ |
|
54
|
|
|
protected $urlAliasService; |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* Construct repository object from aggregated repository. |
|
58
|
|
|
*/ |
|
59
|
|
|
public function __construct( |
|
60
|
|
|
RepositoryInterface $repository, |
|
61
|
|
|
ContentService $contentService, |
|
62
|
|
|
ContentTypeService $contentTypeService, |
|
63
|
|
|
RoleService $roleService, |
|
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
|
|
|
) { |
|
73
|
|
|
$this->repository = $repository; |
|
74
|
|
|
$this->contentService = $contentService; |
|
75
|
|
|
$this->contentTypeService = $contentTypeService; |
|
76
|
|
|
$this->roleService = $roleService; |
|
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
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
public function getCurrentUser() |
|
88
|
|
|
{ |
|
89
|
|
|
return $this->repository->getCurrentUser(); |
|
|
|
|
|
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
public function getCurrentUserReference() |
|
93
|
|
|
{ |
|
94
|
|
|
return $this->repository->getCurrentUserReference(); |
|
|
|
|
|
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
public function setCurrentUser(UserReference $user) |
|
98
|
|
|
{ |
|
99
|
|
|
return $this->repository->setCurrentUser($user); |
|
|
|
|
|
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
public function sudo(\Closure $callback) |
|
103
|
|
|
{ |
|
104
|
|
|
return $this->repository->sudo($callback, $this); |
|
|
|
|
|
|
105
|
|
|
} |
|
106
|
|
|
|
|
107
|
|
|
public function hasAccess($module, $function, UserReference $user = null) |
|
108
|
|
|
{ |
|
109
|
|
|
return $this->repository->hasAccess($module, $function, $user); |
|
|
|
|
|
|
110
|
|
|
} |
|
111
|
|
|
|
|
112
|
|
|
public function canUser($module, $function, ValueObject $object, $targets = null) |
|
113
|
|
|
{ |
|
114
|
|
|
return $this->repository->canUser($module, $function, $object, $targets); |
|
|
|
|
|
|
115
|
|
|
} |
|
116
|
|
|
|
|
117
|
|
|
public function getContentService() |
|
118
|
|
|
{ |
|
119
|
|
|
return $this->contentService; |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
|
|
public function getContentLanguageService() |
|
123
|
|
|
{ |
|
124
|
|
|
return $this->languageService; |
|
125
|
|
|
} |
|
126
|
|
|
|
|
127
|
|
|
public function getContentTypeService() |
|
128
|
|
|
{ |
|
129
|
|
|
return $this->contentTypeService; |
|
130
|
|
|
} |
|
131
|
|
|
|
|
132
|
|
|
public function getLocationService() |
|
133
|
|
|
{ |
|
134
|
|
|
return $this->locationService; |
|
135
|
|
|
} |
|
136
|
|
|
|
|
137
|
|
|
public function getTrashService() |
|
138
|
|
|
{ |
|
139
|
|
|
return $this->trashService; |
|
140
|
|
|
} |
|
141
|
|
|
|
|
142
|
|
|
public function getSectionService() |
|
143
|
|
|
{ |
|
144
|
|
|
return $this->sectionService; |
|
145
|
|
|
} |
|
146
|
|
|
|
|
147
|
|
|
public function getUserService() |
|
148
|
|
|
{ |
|
149
|
|
|
return $this->userService; |
|
150
|
|
|
} |
|
151
|
|
|
|
|
152
|
|
|
public function getURLAliasService() |
|
153
|
|
|
{ |
|
154
|
|
|
return $this->urlAliasService; |
|
155
|
|
|
} |
|
156
|
|
|
|
|
157
|
|
|
public function getURLWildcardService() |
|
158
|
|
|
{ |
|
159
|
|
|
return $this->repository->getURLWildcardService(); |
|
160
|
|
|
} |
|
161
|
|
|
|
|
162
|
|
|
public function getObjectStateService() |
|
163
|
|
|
{ |
|
164
|
|
|
return $this->objectStateService; |
|
165
|
|
|
} |
|
166
|
|
|
|
|
167
|
|
|
public function getRoleService() |
|
168
|
|
|
{ |
|
169
|
|
|
return $this->roleService; |
|
170
|
|
|
} |
|
171
|
|
|
|
|
172
|
|
|
public function getSearchService() |
|
173
|
|
|
{ |
|
174
|
|
|
return $this->searchService; |
|
175
|
|
|
} |
|
176
|
|
|
|
|
177
|
|
|
public function getFieldTypeService() |
|
178
|
|
|
{ |
|
179
|
|
|
return $this->repository->getFieldTypeService(); |
|
180
|
|
|
} |
|
181
|
|
|
|
|
182
|
|
|
public function getPermissionResolver() |
|
183
|
|
|
{ |
|
184
|
|
|
return $this->repository->getPermissionResolver(); |
|
185
|
|
|
} |
|
186
|
|
|
|
|
187
|
|
|
public function getURLService() |
|
188
|
|
|
{ |
|
189
|
|
|
return $this->repository->getURLService(); |
|
190
|
|
|
} |
|
191
|
|
|
|
|
192
|
|
|
public function getBookmarkService() |
|
193
|
|
|
{ |
|
194
|
|
|
return $this->repository->getBookmarkService(); |
|
195
|
|
|
} |
|
196
|
|
|
|
|
197
|
|
|
public function beginTransaction() |
|
198
|
|
|
{ |
|
199
|
|
|
return $this->repository->beginTransaction(); |
|
200
|
|
|
} |
|
201
|
|
|
|
|
202
|
|
|
public function commit() |
|
203
|
|
|
{ |
|
204
|
|
|
return $this->repository->commit(); |
|
205
|
|
|
} |
|
206
|
|
|
|
|
207
|
|
|
public function rollback() |
|
208
|
|
|
{ |
|
209
|
|
|
return $this->repository->rollback(); |
|
210
|
|
|
} |
|
211
|
|
|
} |
|
212
|
|
|
|
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.