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

Inheritance: implements eZ\Publish\SPI\Persistence\Content\Type\Handler
Show file Open project: ezsystems/ezpublish-kernel

Protected Properties

Property Type Description
$contentTypes array Local in-memory cache for content types in one single request.
$fieldDefinitions array Local in-memory cache for field definitions in one single request.
$groups array Local in-memory cache for groups in one single request.
$innerHandler eZ\Publish\SPI\Persistence\Content\Type\Handler Inner handler to dispatch calls to.
$searchableFieldMap array Local in-memory cache for searchable field map in one single request.

Public Methods

Method Description
__construct ( eZ\Publish\SPI\Persistence\Content\Type\Handler $handler ) Creates a new content type handler.
addFieldDefinition ( mixed $contentTypeId, integer $status, eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDefinition ) Adds a new field definition to an existing Type.
clearCache ( ) Clear internal caches.
copy ( mixed $userId, mixed $contentTypeId, integer $status ) : eZ\Publish\SPI\Persistence\Content\Type
create ( eZ\Publish\SPI\Persistence\Content\Type\CreateStruct $createStruct ) : eZ\Publish\SPI\Persistence\Content\Type
createDraft ( mixed $modifierId, mixed $contentTypeId ) : eZ\Publish\SPI\Persistence\Content\Type Creates a draft of existing defined content type.
createGroup ( eZ\Publish\SPI\Persistence\Content\Type\Group\CreateStruct $createStruct ) : Group
delete ( mixed $contentTypeId, integer $status ) : boolean
deleteGroup ( mixed $groupId )
getContentCount ( mixed $contentTypeId ) : integer Counts the number of Content instances of the ContentType identified by given $contentTypeId.
getFieldDefinition ( mixed $id, integer $status ) : eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition Returns field definition for the given field definition id.
getSearchableFieldMap ( )
link ( mixed $groupId, mixed $contentTypeId, $status ) Link a content type group with a content type.
load ( integer $contentTypeId, integer $status = Type::STATUS_DEFINED ) : eZ\Publish\SPI\Persistence\Content\Type
loadAllGroups ( ) : Group[]
loadByIdentifier ( string $identifier ) : eZ\Publish\SPI\Persistence\Content\Type Load a (defined) content type by identifier.
loadByRemoteId ( mixed $remoteId ) : eZ\Publish\SPI\Persistence\Content\Type Load a (defined) content type by remote id.
loadContentTypes ( mixed $groupId, integer $status ) : eZ\Publish\SPI\Persistence\Content\Type[]
loadGroup ( mixed $groupId ) : Group
loadGroupByIdentifier ( string $identifier ) : eZ\Publish\SPI\Persistence\Content\Type\Group
publish ( mixed $contentTypeId ) Update content objects.
removeFieldDefinition ( mixed $contentTypeId, $status, mixed $fieldDefinitionId ) : boolean Removes a field definition from an existing Type.
unlink ( mixed $groupId, mixed $contentTypeId, integer $status ) Unlink a content type group from a content type.
update ( mixed $typeId, integer $status, eZ\Publish\SPI\Persistence\Content\Type\UpdateStruct $contentType ) : eZ\Publish\SPI\Persistence\Content\Type
updateFieldDefinition ( mixed $contentTypeId, $status, eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDefinition ) This method updates the given $fieldDefinition on a Type.
updateGroup ( eZ\Publish\SPI\Persistence\Content\Type\Group\UpdateStruct $struct ) : eZ\Publish\SPI\Persistence\Content\Type\Group

Protected Methods

Method Description
loadFromRows ( array $rows, mixed $typeIdentifier, integer $status ) : eZ\Publish\SPI\Persistence\Content\Type Loads a single Type from $rows.

Method Details

__construct() public method

Creates a new content type handler.
public __construct ( eZ\Publish\SPI\Persistence\Content\Type\Handler $handler )
$handler eZ\Publish\SPI\Persistence\Content\Type\Handler

addFieldDefinition() public method

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.
public addFieldDefinition ( mixed $contentTypeId, integer $status, eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDefinition )
$contentTypeId mixed
$status integer One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
$fieldDefinition eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition

clearCache() public method

Clear internal caches.
public clearCache ( )

copy() public method

public copy ( mixed $userId, mixed $contentTypeId, integer $status ) : eZ\Publish\SPI\Persistence\Content\Type
$userId mixed
$contentTypeId mixed
$status integer One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
return eZ\Publish\SPI\Persistence\Content\Type

create() public method

public create ( eZ\Publish\SPI\Persistence\Content\Type\CreateStruct $createStruct ) : eZ\Publish\SPI\Persistence\Content\Type
$createStruct eZ\Publish\SPI\Persistence\Content\Type\CreateStruct
return eZ\Publish\SPI\Persistence\Content\Type

createDraft() public method

Updates modified date, sets $modifierId and status to Type::STATUS_DRAFT on the new returned draft.
public createDraft ( mixed $modifierId, mixed $contentTypeId ) : eZ\Publish\SPI\Persistence\Content\Type
$modifierId mixed
$contentTypeId mixed
return eZ\Publish\SPI\Persistence\Content\Type

createGroup() public method

public createGroup ( eZ\Publish\SPI\Persistence\Content\Type\Group\CreateStruct $createStruct ) : Group
$createStruct eZ\Publish\SPI\Persistence\Content\Type\Group\CreateStruct
return Group

delete() public method

public delete ( mixed $contentTypeId, integer $status ) : boolean
$contentTypeId mixed
$status integer
return boolean

deleteGroup() public method

public deleteGroup ( mixed $groupId )
$groupId mixed

getContentCount() public method

Counts the number of Content instances of the ContentType identified by given $contentTypeId.
public getContentCount ( mixed $contentTypeId ) : integer
$contentTypeId mixed
return integer

getFieldDefinition() public method

Returns field definition for the given field definition id.
public getFieldDefinition ( mixed $id, integer $status ) : eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition
$id mixed
$status integer One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
return eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition

getSearchableFieldMap() public method

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

load() public method

public load ( integer $contentTypeId, integer $status = Type::STATUS_DEFINED ) : eZ\Publish\SPI\Persistence\Content\Type
$contentTypeId integer
$status integer
return eZ\Publish\SPI\Persistence\Content\Type

loadAllGroups() public method

public loadAllGroups ( ) : Group[]
return Group[]

loadByIdentifier() public method

Load a (defined) content type by identifier.
public loadByIdentifier ( string $identifier ) : eZ\Publish\SPI\Persistence\Content\Type
$identifier string
return eZ\Publish\SPI\Persistence\Content\Type

loadByRemoteId() public method

Load a (defined) content type by remote id.
public loadByRemoteId ( mixed $remoteId ) : eZ\Publish\SPI\Persistence\Content\Type
$remoteId mixed
return eZ\Publish\SPI\Persistence\Content\Type

loadContentTypes() public method

public loadContentTypes ( mixed $groupId, integer $status ) : eZ\Publish\SPI\Persistence\Content\Type[]
$groupId mixed
$status integer
return eZ\Publish\SPI\Persistence\Content\Type[]

loadFromRows() protected method

Loads a single Type from $rows.
protected loadFromRows ( array $rows, mixed $typeIdentifier, integer $status ) : eZ\Publish\SPI\Persistence\Content\Type
$rows array
$typeIdentifier mixed
$status integer
return eZ\Publish\SPI\Persistence\Content\Type

loadGroup() public method

public loadGroup ( mixed $groupId ) : Group
$groupId mixed
return Group

loadGroupByIdentifier() public method

public loadGroupByIdentifier ( string $identifier ) : eZ\Publish\SPI\Persistence\Content\Type\Group
$identifier string
return eZ\Publish\SPI\Persistence\Content\Type\Group

publish() public method

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.
public publish ( mixed $contentTypeId )
$contentTypeId mixed

removeFieldDefinition() public method

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.
public removeFieldDefinition ( mixed $contentTypeId, $status, mixed $fieldDefinitionId ) : boolean
$contentTypeId mixed
$fieldDefinitionId mixed
return boolean

update() public method

public update ( mixed $typeId, integer $status, eZ\Publish\SPI\Persistence\Content\Type\UpdateStruct $contentType ) : eZ\Publish\SPI\Persistence\Content\Type
$typeId mixed
$status integer
$contentType eZ\Publish\SPI\Persistence\Content\Type\UpdateStruct
return eZ\Publish\SPI\Persistence\Content\Type

updateFieldDefinition() public method

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.
public updateFieldDefinition ( mixed $contentTypeId, $status, eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDefinition )
$contentTypeId mixed
$fieldDefinition eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition

updateGroup() public method

public updateGroup ( eZ\Publish\SPI\Persistence\Content\Type\Group\UpdateStruct $struct ) : eZ\Publish\SPI\Persistence\Content\Type\Group
$struct eZ\Publish\SPI\Persistence\Content\Type\Group\UpdateStruct
return eZ\Publish\SPI\Persistence\Content\Type\Group

Property Details

$contentTypes protected property

Local in-memory cache for content types in one single request.
protected array $contentTypes
return array

$fieldDefinitions protected property

Local in-memory cache for field definitions in one single request.
protected array $fieldDefinitions
return array

$groups protected property

Local in-memory cache for groups in one single request.
protected array $groups
return array

$innerHandler protected property

Inner handler to dispatch calls to.
protected Handler,eZ\Publish\SPI\Persistence\Content\Type $innerHandler
return eZ\Publish\SPI\Persistence\Content\Type\Handler

$searchableFieldMap protected property

Local in-memory cache for searchable field map in one single request.
protected array $searchableFieldMap
return array