Class

eZ\Publish\Core\SignalSlot\Repository

class Repository implements Repository

Repository class.

Methods

__construct(Repository $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)

Constructor.

User getCurrentUser()

UserReference getCurrentUserReference()

setCurrentUser(UserReference $user)

mixed sudo(Closure $callback)

Allows API execution to be performed with full access sand-boxed.

bool|array hasAccess(string $module, string $function, UserReference $user = null)

bool canUser(string $module, string $function, ValueObject $object, mixed $targets = null)

ContentService getContentService()

Get Content Service.

LanguageService getContentLanguageService()

Get Content Language Service.

ContentTypeService getContentTypeService()

Get Content Type Service.

LocationService getLocationService()

Get Content Location Service.

TrashService getTrashService()

Get Content Trash service.

SectionService getSectionService()

Get Content Section Service.

UserService getUserService()

Get User Service.

URLAliasService getURLAliasService()

Get URLAliasService.

URLWildcardService getURLWildcardService()

Get URLWildcardService.

URLService getURLService()

Get URLService.

ObjectStateService getObjectStateService()

Get ObjectStateService.

RoleService getRoleService()

Get RoleService.

SearchService getSearchService()

Get SearchService.

FieldTypeService getFieldTypeService()

Get FieldTypeService.

PermissionResolver getPermissionResolver()

Get PermissionResolver.

beginTransaction()

Begin transaction.

commit()

Commit transaction.

rollback()

Rollback transaction.

Details

at line 154
public __construct(Repository $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)

Constructor.

Construct repository object from aggregated repository and signal dispatcher

Parameters

Repository $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

at line 197
public User getCurrentUser()

Return Value

User

at line 209
public UserReference getCurrentUserReference()

Return Value

UserReference

at line 221
public setCurrentUser(UserReference $user)

Parameters

UserReference $user

at line 248
public mixed sudo(Closure $callback)

Allows API execution to be performed with full access sand-boxed.

The closure sandbox will do a catch all on exceptions and rethrow after re-setting the sudo flag.

Example use: $location = $repository->sudo( function ( Repository $repo ) use ( $locationId ) { return $repo->getLocationService()->loadLocation( $locationId ) } );

Parameters

Closure $callback

Return Value

mixed

Exceptions

RuntimeException Thrown on recursive sudo() use.
Exception Re throws exceptions thrown inside $callback

at line 266
public bool|array hasAccess(string $module, string $function, UserReference $user = null)

Parameters

string $module The module, aka controller identifier to check permissions on
string $function The function, aka the controller action to check permissions on
UserReference $user

Return Value

bool|array Bool if user has full or no access, array if limitations if not

at line 289
public bool canUser(string $module, string $function, ValueObject $object, mixed $targets = null)

Parameters

string $module The module, aka controller identifier to check permissions on
string $function The function, aka the controller action to check permissions on
ValueObject $object The object to check if the user has access to
mixed $targets The location, parent or "assignment" value object, or an array of the same

Return Value

bool

Exceptions

InvalidArgumentException If any of the arguments are invalid
BadStateException If value of the LimitationValue is unsupported

at line 301
public ContentService getContentService()

Get Content Service.

Get service object to perform operations on Content objects and it's aggregate members.

Return Value

ContentService

at line 313
public LanguageService getContentLanguageService()

Get Content Language Service.

Get service object to perform operations on Content language objects

Return Value

LanguageService

at line 326
public ContentTypeService getContentTypeService()

Get Content Type Service.

Get service object to perform operations on Content Type objects and it's aggregate members. ( Group, Field & FieldCategory )

Return Value

ContentTypeService

at line 338
public LocationService getLocationService()

Get Content Location Service.

Get service object to perform operations on Location objects and subtrees

Return Value

LocationService

at line 351
public TrashService getTrashService()

Get Content Trash service.

Trash service allows to perform operations related to location trash (trash/untrash, load/list from trash...)

Return Value

TrashService

at line 363
public SectionService getSectionService()

Get Content Section Service.

Get Section service that lets you manipulate section objects

Return Value

SectionService

at line 375
public UserService getUserService()

Get User Service.

Get service object to perform operations on Users and UserGroup

Return Value

UserService

at line 385
public URLAliasService getURLAliasService()

Get URLAliasService.

Return Value

URLAliasService

at line 395
public URLWildcardService getURLWildcardService()

Get URLWildcardService.

Return Value

URLWildcardService

at line 405
public URLService getURLService()

Get URLService.

Return Value

URLService

at line 415
public ObjectStateService getObjectStateService()

Get ObjectStateService.

Return Value

ObjectStateService

at line 425
public RoleService getRoleService()

Get RoleService.

Return Value

RoleService

at line 435
public SearchService getSearchService()

Get SearchService.

Return Value

SearchService

at line 445
public FieldTypeService getFieldTypeService()

Get FieldTypeService.

Return Value

FieldTypeService

at line 455
public PermissionResolver getPermissionResolver()

Get PermissionResolver.

Return Value

PermissionResolver

at line 466
public beginTransaction()

Begin transaction.

Begins an transaction, make sure you'll call commit or rollback when done, otherwise work will be lost.

at line 484
public commit()

Commit transaction.

Commit transaction, or throw exceptions if no transactions has been started.

Exceptions

RuntimeException If no transaction has been started

at line 502
public rollback()

Rollback transaction.

Rollback transaction, or throw exceptions if no transactions has been started.

Exceptions

RuntimeException If no transaction has been started