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

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

Protected Properties

Property Type Description
$contentTypeGateway Gateway
$mapper Mapper Mapper for Type objects.
$updateHandler eZ\Publish\Core\Persistence\Legacy\Content\Type\Update\Handler Content Type update handler.

Public Methods

Method Description
__construct ( Gateway $contentTypeGateway, Mapper $mapper, Handler $updateHandler ) 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.
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 ) : eZ\Publish\SPI\Persistence\Content\Type\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 Loads a content type by id and status.
loadAllGroups ( ) : eZ\Publish\SPI\Persistence\Content\Type\Group[]
loadByIdentifier ( string $identifier ) : eZ\Publish\SPI\Persistence\Content\Type Loads a (defined) content type by identifier.
loadByRemoteId ( mixed $remoteId ) : eZ\Publish\SPI\Persistence\Content\Type Loads a (defined) content type by remote id.
loadContentTypes ( mixed $groupId, integer $status ) : eZ\Publish\SPI\Persistence\Content\Type[]
loadGroup ( mixed $groupId ) : eZ\Publish\SPI\Persistence\Content\Type\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
internalCreate ( eZ\Publish\SPI\Persistence\Content\Type\CreateStruct $createStruct, mixed | null $contentTypeId = null ) : eZ\Publish\SPI\Persistence\Content\Type Internal method for creating ContentType.
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 ( Gateway $contentTypeGateway, Mapper $mapper, Handler $updateHandler )
$contentTypeGateway Gateway
$mapper Mapper
$updateHandler eZ\Publish\Core\Persistence\Legacy\Content\Type\Update\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

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 ) : eZ\Publish\SPI\Persistence\Content\Type\Group
$createStruct eZ\Publish\SPI\Persistence\Content\Type\Group\CreateStruct
return eZ\Publish\SPI\Persistence\Content\Type\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

internalCreate() protected method

Used by self::create(), self::createDraft() and self::copy()
protected internalCreate ( eZ\Publish\SPI\Persistence\Content\Type\CreateStruct $createStruct, mixed | null $contentTypeId = null ) : eZ\Publish\SPI\Persistence\Content\Type
$createStruct eZ\Publish\SPI\Persistence\Content\Type\CreateStruct
$contentTypeId mixed | null Used by self::createDraft() to retain ContentType id in the draft
return eZ\Publish\SPI\Persistence\Content\Type

load() public method

Note: This method is responsible of having the Field Definitions of the loaded ContentType sorted by placement.
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 ( ) : eZ\Publish\SPI\Persistence\Content\Type\Group[]
return eZ\Publish\SPI\Persistence\Content\Type\Group[]

loadByIdentifier() public method

Note: This method is responsible of having the Field Definitions of the loaded ContentType sorted by placement.
public loadByIdentifier ( string $identifier ) : eZ\Publish\SPI\Persistence\Content\Type
$identifier string
return eZ\Publish\SPI\Persistence\Content\Type

loadByRemoteId() public method

Note: This method is responsible of having the Field Definitions of the loaded ContentType sorted by placement.
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 ) : eZ\Publish\SPI\Persistence\Content\Type\Group
$groupId mixed
return eZ\Publish\SPI\Persistence\Content\Type\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

$contentTypeGateway protected_oe property

protected Gateway,eZ\Publish\Core\Persistence\Legacy\Content\Type $contentTypeGateway
return Gateway

$mapper protected_oe property

Mapper for Type objects.
protected Mapper,eZ\Publish\Core\Persistence\Legacy\Content\Type $mapper
return Mapper

$updateHandler protected_oe property

Content Type update handler.
protected Handler,eZ\Publish\Core\Persistence\Legacy\Content\Type\Update $updateHandler
return eZ\Publish\Core\Persistence\Legacy\Content\Type\Update\Handler