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

Public Member Functions

 __construct (PersistenceHandler $persistenceHandler, array $serviceSettings=array(), User $user=null)
 Constructor. More...
 
 beginTransaction ()
 Begin transaction. More...
 
 commit ()
 Commit transaction. 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...
 
 getNameSchemaService ()
 Get NameSchemaResolverService. More...
 
 getObjectStateService ()
 Get ObjectStateService. More...
 
 getRelationProcessor ()
 Get RelationProcessor. 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...
 
- Public Member Functions inherited from eZ\Publish\API\Repository\Repository
 canUser ($module, $function, ValueObject $object, ValueObject $target=null)
 Indicates if the current user is allowed to perform an action given by the function on the given objects. More...
 

Protected Attributes

 $contentService
 
 $contentTypeService
 
 $fieldTypeService
 
 $languageService
 
 $locationService
 
 $nameSchemaService
 
 $objectStateService
 
 $persistenceHandler
 
 $relationProcessor
 
 $roleService
 
 $searchService
 
 $sectionService
 
 $serviceSettings
 
 $trashService
 
 $urlAliasService
 
 $urlWildcardService
 
 $user
 
 $userService
 

Private Attributes

 $sudoFlag = false
 

Constructor & Destructor Documentation

eZ\Publish\Core\Repository\Repository::__construct ( PersistenceHandler  $persistenceHandler,
array  $serviceSettings = array(),
User  $user = null 
)

Constructor.

Construct repository object with provided storage engine

Parameters
\eZ\Publish\SPI\Persistence\Handler$persistenceHandler
array$serviceSettings
\eZ\Publish\API\Repository\Values\User\User | null$user

Member Function Documentation

eZ\Publish\Core\Repository\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\Repository\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\Repository\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\Repository\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\Repository\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\Repository\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\Repository\Repository::getCurrentUser ( )
eZ\Publish\Core\Repository\Repository::getFieldTypeService ( )
eZ\Publish\Core\Repository\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\Repository\Repository::getNameSchemaService ( )

Get NameSchemaResolverService.

private Internal service for the Core Services

Todo:
Move out from this & other repo instances when services becomes proper services in DIC terms using factory.
Returns
eZ\Publish\Core\Repository\Repository::getObjectStateService ( )
eZ\Publish\Core\Repository\Repository::getRelationProcessor ( )

Get RelationProcessor.

private Internal service for the Core Services

Todo:
Move out from this & other repo instances when services becomes proper services in DIC terms using factory.
Returns
eZ\Publish\Core\Repository\Repository::getRoleService ( )
eZ\Publish\Core\Repository\Repository::getSearchService ( )
eZ\Publish\Core\Repository\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\Repository\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\Repository\Repository::getURLAliasService ( )
eZ\Publish\Core\Repository\Repository::getURLWildcardService ( )
eZ\Publish\Core\Repository\Repository::getUserService ( )

Get User Service.

Get service object to perform operations on Users and UserGroup

Returns

Implements eZ\Publish\API\Repository\Repository.

Referenced by eZ\Publish\Core\Repository\Repository\getCurrentUser().

eZ\Publish\Core\Repository\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\Repository\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\Repository\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.

Referenced by eZ\Publish\Core\Repository\Repository\__construct().

eZ\Publish\Core\Repository\Repository::sudo ( \Closure  $callback)
final

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\Repository\Repository::$contentService
protected
eZ\Publish\Core\Repository\Repository::$contentTypeService
protected
eZ\Publish\Core\Repository\Repository::$fieldTypeService
protected
eZ\Publish\Core\Repository\Repository::$languageService
protected
eZ\Publish\Core\Repository\Repository::$locationService
protected
eZ\Publish\Core\Repository\Repository::$nameSchemaService
protected
eZ\Publish\Core\Repository\Repository::$objectStateService
protected
eZ\Publish\Core\Repository\Repository::$persistenceHandler
protected
eZ\Publish\Core\Repository\Repository::$relationProcessor
protected
eZ\Publish\Core\Repository\Repository::$roleService
protected
eZ\Publish\Core\Repository\Repository::$searchService
protected
eZ\Publish\Core\Repository\Repository::$sectionService
protected
eZ\Publish\Core\Repository\Repository::$serviceSettings
protected
eZ\Publish\Core\Repository\Repository::$sudoFlag = false
private
eZ\Publish\Core\Repository\Repository::$trashService
protected
eZ\Publish\Core\Repository\Repository::$urlAliasService
protected
eZ\Publish\Core\Repository\Repository::$urlWildcardService
protected
eZ\Publish\Core\Repository\Repository::$userService
protected

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