Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Core/SignalSlot/Repository.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\SignalSlot;
8
9 use eZ\Publish\API\Repository\BookmarkService;
10 use eZ\Publish\API\Repository\Repository as RepositoryInterface;
11 use eZ\Publish\API\Repository\Values\ValueObject;
12 use eZ\Publish\API\Repository\Values\User\UserReference;
13 use eZ\Publish\SPI\Persistence\TransactionHandler;
14
18 class Repository implements RepositoryInterface
19 {
25 protected $repository;
26
32 protected $signalDispatcher;
33
39 protected $contentService;
40
46 protected $sectionService;
47
53 protected $roleService;
54
60 protected $searchService;
61
67 protected $userService;
68
74 protected $languageService;
75
81 protected $locationService;
82
88 protected $trashService;
89
95 protected $contentTypeService;
96
102 protected $objectStateService;
103
109 protected $fieldTypeService;
110
116 protected $urlAliasService;
117
123 protected $urlWildcardService;
124
130 protected $urlService;
131
137 protected $bookmarkService;
138
144 protected $notificationService;
145
151 protected $userPreferenceService;
152
176 public function __construct(
177 RepositoryInterface $repository,
178 SignalDispatcher $signalDispatcher,
179 ContentService $contentService,
180 ContentTypeService $contentTypeService,
181 FieldTypeService $fieldTypeService,
182 RoleService $roleService,
183 ObjectStateService $objectStateService,
184 URLWildcardService $urlWildcardService,
185 URLAliasService $urlAliasService,
186 UserService $userService,
187 SearchService $searchService,
188 SectionService $sectionService,
189 TrashService $trashService,
190 LocationService $locationService,
191 LanguageService $languageService,
192 URLService $urlService,
193 BookmarkService $bookmarkService,
194 NotificationService $notificationService,
195 UserPreferenceService $userPreferenceService
196 ) {
197 $this->signalDispatcher = $signalDispatcher;
198 $this->repository = $repository;
199 $this->contentService = $contentService;
200 $this->contentTypeService = $contentTypeService;
201 $this->fieldTypeService = $fieldTypeService;
202 $this->roleService = $roleService;
203 $this->objectStateService = $objectStateService;
204 $this->urlWildcardService = $urlWildcardService;
205 $this->urlAliasService = $urlAliasService;
206 $this->userService = $userService;
207 $this->searchService = $searchService;
208 $this->sectionService = $sectionService;
209 $this->trashService = $trashService;
210 $this->locationService = $locationService;
211 $this->languageService = $languageService;
212 $this->urlService = $urlService;
213 $this->bookmarkService = $bookmarkService;
214 $this->notificationService = $notificationService;
215 $this->userPreferenceService = $userPreferenceService;
216 }
217
225 public function getCurrentUser()
226 {
227 return $this->repository->getCurrentUser();
228 }
229
237 public function getCurrentUserReference()
238 {
239 return $this->repository->getCurrentUserReference();
240 }
241
249 public function setCurrentUser(UserReference $user)
250 {
251 return $this->repository->setCurrentUser($user);
252 }
253
257 public function sudo(callable $callback, RepositoryInterface $outerRepository = null)
258 {
259 return $this->repository->sudo($callback, $outerRepository ?? $this);
260 }
261
275 public function hasAccess($module, $function, UserReference $user = null)
276 {
277 return $this->repository->hasAccess($module, $function, $user);
278 }
279
298 public function canUser($module, $function, ValueObject $object, $targets = null)
299 {
300 return $this->repository->canUser($module, $function, $object, $targets);
301 }
302
310 public function getContentService()
311 {
312 return $this->contentService;
313 }
314
322 public function getContentLanguageService()
323 {
324 return $this->languageService;
325 }
326
335 public function getContentTypeService()
336 {
337 return $this->contentTypeService;
338 }
339
347 public function getLocationService()
348 {
349 return $this->locationService;
350 }
351
360 public function getTrashService()
361 {
362 return $this->trashService;
363 }
364
372 public function getSectionService()
373 {
374 return $this->sectionService;
375 }
376
384 public function getUserService()
385 {
386 return $this->userService;
387 }
388
394 public function getURLAliasService()
395 {
396 return $this->urlAliasService;
397 }
398
404 public function getURLWildcardService()
405 {
406 return $this->urlWildcardService;
407 }
408
414 public function getURLService()
415 {
416 return $this->urlService;
417 }
418
424 public function getBookmarkService()
425 {
426 return $this->bookmarkService;
427 }
428
434 public function getNotificationService()
435 {
436 return $this->notificationService;
437 }
438
444 public function getUserPreferenceService()
445 {
446 return $this->userPreferenceService;
447 }
448
454 public function getObjectStateService()
455 {
456 return $this->objectStateService;
457 }
458
464 public function getRoleService()
465 {
466 return $this->roleService;
467 }
468
474 public function getSearchService()
475 {
476 return $this->searchService;
477 }
478
484 public function getFieldTypeService()
485 {
486 return $this->fieldTypeService;
487 }
488
494 public function getPermissionResolver()
495 {
496 return $this->repository->getPermissionResolver();
497 }
498
505 public function beginTransaction()
506 {
507 $return = $this->repository->beginTransaction();
508
509 if ($this->signalDispatcher instanceof TransactionHandler) {
510 $this->signalDispatcher->beginTransaction();
511 }
512
513 return $return;
514 }
515
523 public function commit()
524 {
525 $return = $this->repository->commit();
526
527 if ($this->signalDispatcher instanceof TransactionHandler) {
528 $this->signalDispatcher->commit();
529 }
530
531 return $return;
532 }
533
541 public function rollback()
542 {
543 if ($this->signalDispatcher instanceof TransactionHandler) {
544 $this->signalDispatcher->rollback();
545 }
546
547 return $this->repository->rollback();
548 }
549 }
eZ\Publish\API\Repository\Values\ValueObject
Definition: API/Repository/Values/ValueObject.php:21
eZ\Publish\Core\SignalSlot\ContentService
ContentService class.
Definition: Core/SignalSlot/ContentService.php:40
eZ\Publish\Core\SignalSlot\ContentTypeService
ContentTypeService class.
Definition: Core/SignalSlot/ContentTypeService.php:41
eZ\Publish\Core\SignalSlot\FieldTypeService
FieldTypeService class.
Definition: Core/SignalSlot/FieldTypeService.php:15
eZ\Publish\Core\SignalSlot\LanguageService
LanguageService class.
Definition: Core/SignalSlot/LanguageService.php:22
eZ\Publish\Core\SignalSlot\LocationService
LocationService class.
Definition: Core/SignalSlot/LocationService.php:29
eZ\Publish\Core\SignalSlot\NotificationService
Definition: Core/SignalSlot/NotificationService.php:20
eZ\Publish\Core\SignalSlot\ObjectStateService
ObjectStateService class.
Definition: Core/SignalSlot/ObjectStateService.php:30
eZ\Publish\Core\SignalSlot\Repository
Repository class.
Definition: Core/SignalSlot/Repository.php:19
eZ\Publish\Core\SignalSlot\Repository\getSearchService
getSearchService()
Get SearchService.
Definition: Core/SignalSlot/Repository.php:474
eZ\Publish\Core\SignalSlot\Repository\getSectionService
getSectionService()
Get Content Section Service.
Definition: Core/SignalSlot/Repository.php:372
eZ\Publish\Core\SignalSlot\Repository\$repository
$repository
Definition: Core/SignalSlot/Repository.php:25
eZ\Publish\Core\SignalSlot\Repository\beginTransaction
beginTransaction()
Begin transaction.
Definition: Core/SignalSlot/Repository.php:505
eZ\Publish\Core\SignalSlot\Repository\getURLService
getURLService()
Get URLService.
Definition: Core/SignalSlot/Repository.php:414
eZ\Publish\Core\SignalSlot\Repository\$searchService
$searchService
Definition: Core/SignalSlot/Repository.php:60
eZ\Publish\Core\SignalSlot\Repository\$userPreferenceService
$userPreferenceService
Definition: Core/SignalSlot/Repository.php:151
eZ\Publish\Core\SignalSlot\Repository\$urlWildcardService
$urlWildcardService
Definition: Core/SignalSlot/Repository.php:123
eZ\Publish\Core\SignalSlot\Repository\__construct
__construct(RepositoryInterface $repository, SignalDispatcher $signalDispatcher, ContentService $contentService, ContentTypeService $contentTypeService, FieldTypeService $fieldTypeService, RoleService $roleService, ObjectStateService $objectStateService, URLWildcardService $urlWildcardService, URLAliasService $urlAliasService, UserService $userService, SearchService $searchService, SectionService $sectionService, TrashService $trashService, LocationService $locationService, LanguageService $languageService, URLService $urlService, BookmarkService $bookmarkService, NotificationService $notificationService, UserPreferenceService $userPreferenceService)
Construct repository object from aggregated repository and signal dispatcher.
Definition: Core/SignalSlot/Repository.php:176
eZ\Publish\Core\SignalSlot\Repository\getNotificationService
getNotificationService()
Get NotificationService.
Definition: Core/SignalSlot/Repository.php:434
eZ\Publish\Core\SignalSlot\Repository\$bookmarkService
$bookmarkService
Definition: Core/SignalSlot/Repository.php:137
eZ\Publish\Core\SignalSlot\Repository\getURLWildcardService
getURLWildcardService()
Get URLWildcardService.
Definition: Core/SignalSlot/Repository.php:404
eZ\Publish\Core\SignalSlot\Repository\getURLAliasService
getURLAliasService()
Get URLAliasService.
Definition: Core/SignalSlot/Repository.php:394
eZ\Publish\Core\SignalSlot\Repository\getTrashService
getTrashService()
Get Content Trash service.
Definition: Core/SignalSlot/Repository.php:360
eZ\Publish\Core\SignalSlot\Repository\$roleService
$roleService
Definition: Core/SignalSlot/Repository.php:53
eZ\Publish\Core\SignalSlot\Repository\rollback
rollback()
Rollback transaction.
Definition: Core/SignalSlot/Repository.php:541
eZ\Publish\Core\SignalSlot\Repository\getContentTypeService
getContentTypeService()
Get Content Type Service.
Definition: Core/SignalSlot/Repository.php:335
eZ\Publish\Core\SignalSlot\Repository\$sectionService
$sectionService
Definition: Core/SignalSlot/Repository.php:46
eZ\Publish\Core\SignalSlot\Repository\$urlAliasService
$urlAliasService
Definition: Core/SignalSlot/Repository.php:116
eZ\Publish\Core\SignalSlot\Repository\$signalDispatcher
$signalDispatcher
Definition: Core/SignalSlot/Repository.php:32
eZ\Publish\Core\SignalSlot\Repository\setCurrentUser
setCurrentUser(UserReference $user)
Definition: Core/SignalSlot/Repository.php:249
eZ\Publish\Core\SignalSlot\Repository\getContentLanguageService
getContentLanguageService()
Get Content Language Service.
Definition: Core/SignalSlot/Repository.php:322
eZ\Publish\Core\SignalSlot\Repository\getCurrentUser
getCurrentUser()
Definition: Core/SignalSlot/Repository.php:225
eZ\Publish\Core\SignalSlot\Repository\getFieldTypeService
getFieldTypeService()
Get FieldTypeService.
Definition: Core/SignalSlot/Repository.php:484
eZ\Publish\Core\SignalSlot\Repository\$languageService
$languageService
Definition: Core/SignalSlot/Repository.php:74
eZ\Publish\Core\SignalSlot\Repository\$notificationService
$notificationService
Definition: Core/SignalSlot/Repository.php:144
eZ\Publish\Core\SignalSlot\Repository\getCurrentUserReference
getCurrentUserReference()
Definition: Core/SignalSlot/Repository.php:237
eZ\Publish\Core\SignalSlot\Repository\getPermissionResolver
getPermissionResolver()
Get PermissionResolver.
Definition: Core/SignalSlot/Repository.php:494
eZ\Publish\Core\SignalSlot\Repository\getLocationService
getLocationService()
Get Content Location Service.
Definition: Core/SignalSlot/Repository.php:347
eZ\Publish\Core\SignalSlot\Repository\getUserService
getUserService()
Get User Service.
Definition: Core/SignalSlot/Repository.php:384
eZ\Publish\Core\SignalSlot\Repository\$objectStateService
$objectStateService
Definition: Core/SignalSlot/Repository.php:102
eZ\Publish\Core\SignalSlot\Repository\canUser
canUser($module, $function, ValueObject $object, $targets=null)
Definition: Core/SignalSlot/Repository.php:298
eZ\Publish\Core\SignalSlot\Repository\getBookmarkService
getBookmarkService()
Get BookmarkService.
Definition: Core/SignalSlot/Repository.php:424
eZ\Publish\Core\SignalSlot\Repository\hasAccess
hasAccess($module, $function, UserReference $user=null)
Definition: Core/SignalSlot/Repository.php:275
eZ\Publish\Core\SignalSlot\Repository\getRoleService
getRoleService()
Get RoleService.
Definition: Core/SignalSlot/Repository.php:464
eZ\Publish\Core\SignalSlot\Repository\$contentTypeService
$contentTypeService
Definition: Core/SignalSlot/Repository.php:95
eZ\Publish\Core\SignalSlot\Repository\sudo
sudo(callable $callback, RepositoryInterface $outerRepository=null)
{}
Definition: Core/SignalSlot/Repository.php:257
eZ\Publish\Core\SignalSlot\Repository\commit
commit()
Commit transaction.
Definition: Core/SignalSlot/Repository.php:523
eZ\Publish\Core\SignalSlot\Repository\getUserPreferenceService
getUserPreferenceService()
Get UserPreferenceService.
Definition: Core/SignalSlot/Repository.php:444
eZ\Publish\Core\SignalSlot\Repository\getContentService
getContentService()
Get Content Service.
Definition: Core/SignalSlot/Repository.php:310
eZ\Publish\Core\SignalSlot\Repository\$urlService
$urlService
Definition: Core/SignalSlot/Repository.php:130
eZ\Publish\Core\SignalSlot\Repository\$fieldTypeService
$fieldTypeService
Definition: Core/SignalSlot/Repository.php:109
eZ\Publish\Core\SignalSlot\Repository\getObjectStateService
getObjectStateService()
Get ObjectStateService.
Definition: Core/SignalSlot/Repository.php:454
eZ\Publish\Core\SignalSlot\Repository\$contentService
$contentService
Definition: Core/SignalSlot/Repository.php:39
eZ\Publish\Core\SignalSlot\Repository\$userService
$userService
Definition: Core/SignalSlot/Repository.php:67
eZ\Publish\Core\SignalSlot\Repository\$trashService
$trashService
Definition: Core/SignalSlot/Repository.php:88
eZ\Publish\Core\SignalSlot\Repository\$locationService
$locationService
Definition: Core/SignalSlot/Repository.php:81
eZ\Publish\Core\SignalSlot\RoleService
RoleService class.
Definition: Core/SignalSlot/RoleService.php:44
eZ\Publish\Core\SignalSlot\SearchService
SearchService class.
Definition: Core/SignalSlot/SearchService.php:18
eZ\Publish\Core\SignalSlot\SectionService
SectionService class.
Definition: Core/SignalSlot/SectionService.php:25
eZ\Publish\Core\SignalSlot\SignalDispatcher
Dispatches Signals to their assigned Slots.
Definition: SignalDispatcher.php:20
eZ\Publish\Core\SignalSlot\TrashService
TrashService class.
Definition: Core/SignalSlot/TrashService.php:22
eZ\Publish\Core\SignalSlot\URLAliasService
URLAliasService class.
Definition: Core/SignalSlot/URLAliasService.php:20
eZ\Publish\Core\SignalSlot\URLService
Definition: Core/SignalSlot/URLService.php:16
eZ\Publish\Core\SignalSlot\URLWildcardService
URLWildcardService class.
Definition: Core/SignalSlot/URLWildcardService.php:19
eZ\Publish\Core\SignalSlot\UserPreferenceService
Definition: Core/SignalSlot/UserPreferenceService.php:17
eZ\Publish\Core\SignalSlot\UserService
UserService class.
Definition: Core/SignalSlot/UserService.php:35
eZ\Publish\API\Repository\BookmarkService
Bookmark Service.
Definition: API/Repository/BookmarkService.php:21
eZ\Publish\API\Repository\Repository
Repository interface.
Definition: API/Repository/Repository.php:16
eZ\Publish\API\Repository\Values\User\UserReference
This interface represents a user reference for use in sessions and Repository.
Definition: API/Repository/Values/User/UserReference.php:13
eZ\Publish\SPI\Persistence\TransactionHandler
The Persistence Transaction handler for Storage Engine.
Definition: SPI/Persistence/TransactionHandler.php:15
eZ\Publish\Core\SignalSlot
Definition: Core/SignalSlot/BookmarkService.php:9
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.