eZPublishCommunityProject  2013.9
eZ\Publish\Core\SignalSlot\Repository Class Reference
+ Inheritance diagram for eZ\Publish\Core\SignalSlot\Repository:
+ Collaboration diagram for eZ\Publish\Core\SignalSlot\Repository:

Public Member Functions

 __construct (RepositoryInterface $repository, SignalDispatcher $signalDispatcher)
 Constructor. More...
 
 beginTransaction ()
 Begin transaction. More...
 
 canUser ($module, $function, ValueObject $object, $targets=null)
 Check if user has access to a given action on a given value object. More...
 
 commit ()
 Commit transaction. More...
 
 commitEvent ($event)
 Enqueue an event to be triggered at commit or directly if no transaction has started. More...
 
 createDateTime ($timestamp=null)
 Only for internal use. More...
 
 getContentLanguageService ()
 Get Content Language Service. More...
 
 getContentService ()
 Get Content Service. More...
 
 getContentTypeService ()
 Get Content Type Service. More...
 
 getCurrentUser ()
 Get current user. More...
 
 getFieldTypeService ()
 Get FieldTypeService. More...
 
 getLocationService ()
 Get Content Location Service. More...
 
 getObjectStateService ()
 Get ObjectStateService. More...
 
 getRoleService ()
 Get RoleService. More...
 
 getSearchService ()
 Get SearchService. More...
 
 getSectionService ()
 Get Content Section Service. More...
 
 getTrashService ()
 Get Content Trash service. More...
 
 getURLAliasService ()
 Get URLAliasService. More...
 
 getURLWildcardService ()
 Get URLWildcardService. More...
 
 getUserService ()
 Get User Service. More...
 
 hasAccess ($module, $function, User $user=null)
 Check if user has access to a given module / function. More...
 
 rollback ()
 Rollback transaction. More...
 
 setCurrentUser (User $user)
 Sets the current user to the given $user. More...
 
 sudo (\Closure $callback)
 Allows API execution to be performed with full access sand-boxed. More...
 

Protected Attributes

 $contentService
 
 $contentTypeService
 
 $fieldTypeService
 
 $ioService
 
 $languageService
 
 $locationService
 
 $objectStateService
 
 $repository
 
 $roleService
 
 $searchService
 
 $sectionService
 
 $signalDispatcher
 
 $trashService
 
 $urlAliasService
 
 $urlWildcardService
 
 $userService
 

Constructor & Destructor Documentation

eZ\Publish\Core\SignalSlot\Repository::__construct ( RepositoryInterface  $repository,
SignalDispatcher  $signalDispatcher 
)

Constructor.

Construct repository object from aggregated repository and signal dispatcher

Parameters
\eZ\Publish\API\Repository\Repository$repository
\eZ\Publish\Core\SignalSlot\SignalDispatcher$signalDispatcher

Member Function Documentation

eZ\Publish\Core\SignalSlot\Repository::beginTransaction ( )

Begin transaction.

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

Implements eZ\Publish\API\Repository\Repository.

eZ\Publish\Core\SignalSlot\Repository::canUser (   $module,
  $function,
ValueObject  $object,
  $targets = null 
)

Check if user has access to a given action on a given value object.

Indicates if the current user is allowed to perform an action given by the function on the given objects.

Exceptions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionIf any of the arguments are invalid
\eZ\Publish\API\Repository\Exceptions\BadStateExceptionIf value of the LimitationValue is unsupported
Parameters
string$moduleThe module, aka controller identifier to check permissions on
string$functionThe function, aka the controller action to check permissions on
\eZ\Publish\API\Repository\Values\ValueObject$objectThe object to check if the user has access to
mixed$targetsThe location, parent or "assignment" value object, or an array of the same
Returns
boolean

Implements eZ\Publish\API\Repository\Repository.

eZ\Publish\Core\SignalSlot\Repository::commit ( )

Commit transaction.

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

Exceptions
\RuntimeExceptionIf no transaction has been started

Implements eZ\Publish\API\Repository\Repository.

eZ\Publish\Core\SignalSlot\Repository::commitEvent (   $event)

Enqueue an event to be triggered at commit or directly if no transaction has started.

Parameters
Callable$event

Implements eZ\Publish\API\Repository\Repository.

eZ\Publish\Core\SignalSlot\Repository::createDateTime (   $timestamp = null)

Only for internal use.

Creates a object for $timestamp in the current time zone

Parameters
int$timestamp
Returns
eZ\Publish\Core\SignalSlot\Repository::getContentLanguageService ( )

Get Content Language Service.

Get service object to perform operations on Content language objects

Returns

Implements eZ\Publish\API\Repository\Repository.

eZ\Publish\Core\SignalSlot\Repository::getContentService ( )

Get Content Service.

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

Returns

Implements eZ\Publish\API\Repository\Repository.

eZ\Publish\Core\SignalSlot\Repository::getContentTypeService ( )

Get Content Type Service.

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

Returns

Implements eZ\Publish\API\Repository\Repository.

eZ\Publish\Core\SignalSlot\Repository::getCurrentUser ( )

Get current user.

Returns

Implements eZ\Publish\API\Repository\Repository.

eZ\Publish\Core\SignalSlot\Repository::getFieldTypeService ( )
eZ\Publish\Core\SignalSlot\Repository::getLocationService ( )

Get Content Location Service.

Get service object to perform operations on Location objects and subtrees

Returns

Implements eZ\Publish\API\Repository\Repository.

eZ\Publish\Core\SignalSlot\Repository::getObjectStateService ( )
eZ\Publish\Core\SignalSlot\Repository::getRoleService ( )
eZ\Publish\Core\SignalSlot\Repository::getSearchService ( )
eZ\Publish\Core\SignalSlot\Repository::getSectionService ( )

Get Content Section Service.

Get Section service that lets you manipulate section objects

Returns

Implements eZ\Publish\API\Repository\Repository.

eZ\Publish\Core\SignalSlot\Repository::getTrashService ( )

Get Content Trash service.

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

Returns

Implements eZ\Publish\API\Repository\Repository.

eZ\Publish\Core\SignalSlot\Repository::getURLAliasService ( )
eZ\Publish\Core\SignalSlot\Repository::getURLWildcardService ( )
eZ\Publish\Core\SignalSlot\Repository::getUserService ( )

Get User Service.

Get service object to perform operations on Users and UserGroup

Returns

Implements eZ\Publish\API\Repository\Repository.

eZ\Publish\Core\SignalSlot\Repository::hasAccess (   $module,
  $function,
User  $user = null 
)

Check if user has access to a given module / function.

Low level function, use canUser instead if you have objects to check against.

Parameters
string$module
string$function
\eZ\Publish\API\Repository\Values\User\User$user
Returns
boolean|array Bool if user has full or no access, array if limitations if not

Implements eZ\Publish\API\Repository\Repository.

eZ\Publish\Core\SignalSlot\Repository::rollback ( )

Rollback transaction.

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

Exceptions
\RuntimeExceptionIf no transaction has been started

Implements eZ\Publish\API\Repository\Repository.

eZ\Publish\Core\SignalSlot\Repository::setCurrentUser ( User  $user)

Sets the current user to the given $user.

Parameters
\eZ\Publish\API\Repository\Values\User\User$user
Returns
void

Implements eZ\Publish\API\Repository\Repository.

eZ\Publish\Core\SignalSlot\Repository::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 ( $repo ) use ( $locationId ) { return $repo->getLocationService()->loadLocation( $locationId ) } );

private This function is not official API atm, and can change anytime.

Parameters
\Closure$callback
Exceptions
\RuntimeExceptionThrown on recursive sudo() use.
\ExceptionRe throws exceptions thrown inside $callback
Returns
mixed

Member Data Documentation

eZ\Publish\Core\SignalSlot\Repository::$contentService
protected
eZ\Publish\Core\SignalSlot\Repository::$contentTypeService
protected
eZ\Publish\Core\SignalSlot\Repository::$fieldTypeService
protected
eZ\Publish\Core\SignalSlot\Repository::$ioService
protected
eZ\Publish\Core\SignalSlot\Repository::$languageService
protected
eZ\Publish\Core\SignalSlot\Repository::$locationService
protected
eZ\Publish\Core\SignalSlot\Repository::$objectStateService
protected
eZ\Publish\Core\SignalSlot\Repository::$repository
protected
eZ\Publish\Core\SignalSlot\Repository::$roleService
protected
eZ\Publish\Core\SignalSlot\Repository::$searchService
protected
eZ\Publish\Core\SignalSlot\Repository::$sectionService
protected
eZ\Publish\Core\SignalSlot\Repository::$trashService
protected
eZ\Publish\Core\SignalSlot\Repository::$urlAliasService
protected
eZ\Publish\Core\SignalSlot\Repository::$urlWildcardService
protected
eZ\Publish\Core\SignalSlot\Repository::$userService
protected

The documentation for this class was generated from the following file: