Class

eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler

class MemoryCachingHandler implements Handler

Methods

__construct(Handler $handler)

Creates a new content type handler.

Group createGroup(CreateStruct $createStruct)

Group updateGroup(UpdateStruct $struct)

deleteGroup(mixed $groupId)

Group loadGroup(mixed $groupId)

Group[] loadGroups(array $groupIds)

Return list of unique Content Type Groups, with group id as key.

Group loadGroupByIdentifier(string $identifier)

Group[] loadAllGroups()

Type[] loadContentTypes(mixed $groupId, int $status)

Type load(int $contentTypeId, int $status = Type::STATUS_DEFINED)

Type loadByIdentifier(string $identifier)

Load a (defined) content type by identifier.

Type loadByRemoteId(mixed $remoteId)

Load a (defined) content type by remote id.

Type create(CreateStruct $createStruct)

Type update(mixed $typeId, int $status, UpdateStruct $contentType)

bool delete(mixed $contentTypeId, int $status)

Type createDraft(mixed $modifierId, mixed $contentTypeId)

Creates a draft of existing defined content type.

Type copy(mixed $userId, mixed $contentTypeId, int $status)

unlink(mixed $groupId, mixed $contentTypeId, int $status)

Unlink a content type group from a content type.

link(mixed $groupId, mixed $contentTypeId, int $status)

Link a content type group with a content type.

FieldDefinition getFieldDefinition(mixed $id, int $status)

Returns field definition for the given field definition id.

int getContentCount(mixed $contentTypeId)

Counts the number of Content instances of the ContentType identified by given $contentTypeId.

FieldDefinition addFieldDefinition(mixed $contentTypeId, int $status, FieldDefinition $fieldDefinition)

Adds a new field definition to an existing Type.

bool removeFieldDefinition(mixed $contentTypeId, int $status, mixed $fieldDefinitionId)

Removes a field definition from an existing Type.

updateFieldDefinition(mixed $contentTypeId, int $status, FieldDefinition $fieldDefinition)

This method updates the given $fieldDefinition on a Type.

publish(mixed $contentTypeId)

Update content objects.

array getSearchableFieldMap()

clearCache()

Clear internal caches.

Details

at line 62
public __construct(Handler $handler)

Creates a new content type handler.

Parameters

Handler $handler

at line 72
public Group createGroup(CreateStruct $createStruct)

Parameters

CreateStruct $createStruct

Return Value

Group

at line 84
public Group updateGroup(UpdateStruct $struct)

Parameters

UpdateStruct $struct

Return Value

Group

at line 97
public deleteGroup(mixed $groupId)

Parameters

mixed $groupId

Exceptions

BadStateException If type group contains types
NotFoundException If type group with id is not found

at line 111
public Group loadGroup(mixed $groupId)

Parameters

mixed $groupId

Return Value

Group

Exceptions

NotFoundException If type group with $groupId is not found

at line 123
public Group[] loadGroups(array $groupIds)

Return list of unique Content Type Groups, with group id as key.

Missing items (NotFound) will be missing from the array and not cause an exception, it's up to calling logic to determine if this should cause exception or not.

Parameters

array $groupIds

Return Value

Group[]

at line 144
public Group loadGroupByIdentifier(string $identifier)

Parameters

string $identifier

Return Value

Group

Exceptions

NotFoundException If type group with $identifier is not found

at line 156
public Group[] loadAllGroups()

Return Value

Group[]

at line 167
public Type[] loadContentTypes(mixed $groupId, int $status)

Parameters

mixed $groupId
int $status One of Type::STATUSDEFINED|Type::STATUSDRAFT|Type::STATUS_MODIFIED

Return Value

Type[]

at line 178
public Type load(int $contentTypeId, int $status = Type::STATUS_DEFINED)

Parameters

int $contentTypeId
int $status One of Type::STATUSDEFINED|Type::STATUSDRAFT|Type::STATUS_MODIFIED

Return Value

Type

at line 197
public Type loadByIdentifier(string $identifier)

Load a (defined) content type by identifier.

Parameters

string $identifier

Return Value

Type

Exceptions

NotFoundException If defined type is not found

at line 216
public Type loadByRemoteId(mixed $remoteId)

Load a (defined) content type by remote id.

Parameters

mixed $remoteId

Return Value

Type

Exceptions

NotFoundException If defined type is not found

at line 250
public Type create(CreateStruct $createStruct)

Parameters

CreateStruct $createStruct

Return Value

Type

at line 264
public Type update(mixed $typeId, int $status, UpdateStruct $contentType)

Parameters

mixed $typeId
int $status One of Type::STATUSDEFINED|Type::STATUSDRAFT|Type::STATUS_MODIFIED
UpdateStruct $contentType

Return Value

Type

at line 279
public bool delete(mixed $contentTypeId, int $status)

Parameters

mixed $contentTypeId
int $status One of Type::STATUSDEFINED|Type::STATUSDRAFT|Type::STATUS_MODIFIED

Return Value

bool

Exceptions

BadStateException If type is defined and still has content

at line 298
public Type createDraft(mixed $modifierId, mixed $contentTypeId)

Creates a draft of existing defined content type.

Updates modified date, sets $modifierId and status to Type::STATUS_DRAFT on the new returned draft.

Parameters

mixed $modifierId
mixed $contentTypeId

Return Value

Type

Exceptions

NotFoundException If type with defined status is not found

at line 312
public Type copy(mixed $userId, mixed $contentTypeId, int $status)

Parameters

mixed $userId
mixed $contentTypeId
int $status One of Type::STATUSDEFINED|Type::STATUSDRAFT|Type::STATUS_MODIFIED

Return Value

Type

Unlink a content type group from a content type.

Parameters

mixed $groupId
mixed $contentTypeId
int $status One of Type::STATUSDEFINED|Type::STATUSDRAFT|Type::STATUS_MODIFIED

Exceptions

NotFoundException If group or type with provided status is not found
BadStateException If $groupId is last group on $contentTypeId or not a group assigned to type

Link a content type group with a content type.

Parameters

mixed $groupId
mixed $contentTypeId
int $status One of Type::STATUSDEFINED|Type::STATUSDRAFT|Type::STATUS_MODIFIED

Exceptions

NotFoundException If group or type with provided status is not found
BadStateException If type is already part of group

at line 367
public FieldDefinition getFieldDefinition(mixed $id, int $status)

Returns field definition for the given field definition id.

Parameters

mixed $id
int $status One of Type::STATUSDEFINED|Type::STATUSDRAFT|Type::STATUS_MODIFIED

Return Value

FieldDefinition

Exceptions

NotFoundException If field definition is not found

at line 384
public int getContentCount(mixed $contentTypeId)

Counts the number of Content instances of the ContentType identified by given $contentTypeId.

Parameters

mixed $contentTypeId

Return Value

int

at line 400
public FieldDefinition addFieldDefinition(mixed $contentTypeId, int $status, FieldDefinition $fieldDefinition)

Adds a new field definition to an existing Type.

This method creates a new status of the Type with the $fieldDefinition added. It does not update existing content objects depending on the field (default) values.

Parameters

mixed $contentTypeId
int $status One of Type::STATUSDEFINED|Type::STATUSDRAFT|Type::STATUS_MODIFIED
FieldDefinition $fieldDefinition

Return Value

FieldDefinition

at line 419
public bool removeFieldDefinition(mixed $contentTypeId, int $status, mixed $fieldDefinitionId)

Removes a field definition from an existing Type.

This method creates a new status of the Type with the field definition referred to by $fieldDefinitionId removed. It does not update existing content objects depending on the field (default) values.

Parameters

mixed $contentTypeId
int $status One of Type::STATUSDEFINED|Type::STATUSDRAFT|Type::STATUS_MODIFIED
mixed $fieldDefinitionId

Return Value

bool

at line 437
public updateFieldDefinition(mixed $contentTypeId, int $status, FieldDefinition $fieldDefinition)

This method updates the given $fieldDefinition on a Type.

This method creates a new status of the Type with the updated $fieldDefinition. It does not update existing content objects depending on the field (default) values.

Parameters

mixed $contentTypeId
int $status One of Type::STATUSDEFINED|Type::STATUSDRAFT|Type::STATUS_MODIFIED
FieldDefinition $fieldDefinition

at line 456
public publish(mixed $contentTypeId)

Update content objects.

Updates content objects, depending on the changed field definitions.

A content type has a state which tells if its content objects yet have been adapted.

Flags the content type as updated.

Parameters

mixed $contentTypeId

at line 466
public array getSearchableFieldMap()

Return Value

array

See also

\eZ\Publish\SPI\Persistence\Content\Type\Handler::getSearchableFieldMap

at line 478
public clearCache()

Clear internal caches.