eZPublishCommunityProject  2013.5
eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler Class Reference
+ Inheritance diagram for eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler:
+ Collaboration diagram for eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler:

Public Member Functions

 __construct (Gateway $contentTypeGateway, Mapper $mapper, UpdateHandler $updateHandler)
 Creates a new content type handler. More...
 
 addFieldDefinition ($contentTypeId, $status, FieldDefinition $fieldDefinition)
 Adds a new field definition to an existing Type. More...
 
 copy ($userId, $contentTypeId, $status)
 
 create (CreateStruct $createStruct)
 
 createDraft ($modifierId, $contentTypeId)
 Creates a draft of existing defined content type. More...
 
 createGroup (GroupCreateStruct $createStruct)
 
 delete ($contentTypeId, $status)
 
 deleteGroup ($groupId)
 
 getFieldDefinition ($id, $status)
 Returns field definition for the given field definition id. More...
 
 link ($groupId, $contentTypeId, $status)
 Link a content type group with a content type. More...
 
 load ($contentTypeId, $status=Type::STATUS_DEFINED)
 
 loadAllGroups ()
 
 loadByIdentifier ($identifier)
 Loads a (defined) content type by identifier. More...
 
 loadByRemoteId ($remoteId)
 Loads a (defined) content type by remote id. More...
 
 loadContentTypes ($groupId, $status=0)
 
 loadGroup ($groupId)
 
 loadGroupByIdentifier ($identifier)
 
 publish ($contentTypeId)
 Update content objects. More...
 
 removeFieldDefinition ($contentTypeId, $status, $fieldDefinitionId)
 Removes a field definition from an existing Type. More...
 
 unlink ($groupId, $contentTypeId, $status)
 Unlink a content type group from a content type. More...
 
 update ($typeId, $status, UpdateStruct $contentType)
 
 updateFieldDefinition ($contentTypeId, $status, FieldDefinition $fieldDefinition)
 This method updates the given $fieldDefinition on a Type. More...
 
 updateGroup (GroupUpdateStruct $struct)
 
- Public Member Functions inherited from eZ\Publish\SPI\Persistence\Content\Type\Handler
 create (CreateStruct $contentType)
 
 update ($contentTypeId, $status, UpdateStruct $contentType)
 

Protected Member Functions

 internalCreate (CreateStruct $createStruct, $contentTypeId=null)
 Internal method for creating ContentType. More...
 
 loadFromRows (array $rows, $typeIdentifier, $status)
 Loads a single Type from $rows. More...
 

Protected Attributes

 $contentTypeGateway
 
 $mapper
 
 $updateHandler
 

Constructor & Destructor Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::__construct ( Gateway  $contentTypeGateway,
Mapper  $mapper,
UpdateHandler  $updateHandler 
)

Creates a new content type handler.

Parameters
\eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway$contentTypeGateway
\eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper$mapper
\eZ\Publish\Core\Persistence\Legacy\Content\Type\Update\Handler$updateHandler

Member Function Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::addFieldDefinition (   $contentTypeId,
  $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$statusOne of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
\eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition$fieldDefinition
Returns
void

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::copy (   $userId,
  $contentTypeId,
  $status 
)
Parameters
mixed$userId
mixed$contentTypeId
int$statusOne of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
Returns
Type

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::create ( CreateStruct  $createStruct)
Parameters
\eZ\Publish\SPI\Persistence\Content\Type\CreateStruct$createStruct
Returns
eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::createDraft (   $modifierId,
  $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
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf type with defined status is not found
Returns

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::createGroup ( GroupCreateStruct  $createStruct)
Parameters
\eZ\Publish\SPI\Persistence\Content\Type\Group\CreateStruct$createStruct
Returns
Group

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::delete (   $contentTypeId,
  $status 
)
Exceptions
\eZ\Publish\API\Repository\Exceptions\BadStateExceptionIf type is defined and still has content
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf type is not found
Parameters
mixed$contentTypeId
int$status
Returns
boolean

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::deleteGroup (   $groupId)
Parameters
mixed$groupId
Exceptions
\eZ\Publish\API\Repository\Exceptions\BadStateExceptionIf type group contains types
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf type group with id is not found

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::getFieldDefinition (   $id,
  $status 
)

Returns field definition for the given field definition id.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf field definition is not found
Parameters
mixed$id
int$statusOne of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
Returns

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::internalCreate ( CreateStruct  $createStruct,
  $contentTypeId = null 
)
protected

Internal method for creating ContentType.

Used by self::create(), self::createDraft() and self::copy()

Parameters
\eZ\Publish\SPI\Persistence\Content\Type\CreateStruct$createStruct
mixed | null$contentTypeIdUsed by self::createDraft() to retain ContentType id in the draft
Returns
eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::link (   $groupId,
  $contentTypeId,
  $status 
)

Link a content type group with a content type.

Parameters
mixed$groupId
mixed$contentTypeId
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf group or type with provided status is not found
\eZ\Publish\API\Repository\Exceptions\BadStateExceptionIf type is already part of group
Todo:
Above throws are not implemented

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::load (   $contentTypeId,
  $status = Type::STATUS_DEFINED 
)
Parameters
int$contentTypeId
int$status
Returns

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::loadAllGroups ( )
eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::loadByIdentifier (   $identifier)

Loads a (defined) content type by identifier.

Parameters
string$identifier
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf defined type is not found
Returns

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::loadByRemoteId (   $remoteId)

Loads a (defined) content type by remote id.

Parameters
mixed$remoteId
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf defined type is not found
Returns

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::loadContentTypes (   $groupId,
  $status = 0 
)
Parameters
mixed$groupId
int$status
Returns
Type[]

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::loadFromRows ( array  $rows,
  $typeIdentifier,
  $status 
)
protected
eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::loadGroup (   $groupId)
Parameters
mixed$groupId
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf type group with $groupId is not found
Returns
Group

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler\updateGroup().

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::loadGroupByIdentifier (   $identifier)
Parameters
string$identifier
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf type group with $identifier is not found
Returns

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::publish (   $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
Returns
void

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::removeFieldDefinition (   $contentTypeId,
  $status,
  $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
mixed$fieldDefinitionId
Returns
boolean

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::unlink (   $groupId,
  $contentTypeId,
  $status 
)

Unlink a content type group from a content type.

Parameters
mixed$groupId
mixed$contentTypeId
int$status
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf group or type with provided status is not found
\eZ\Publish\API\Repository\Exceptions\BadStateExceptionIf $groupId is last group on $contentTypeId or not a group assigned to type
Todo:
Add throws for NotFound and BadState when group is not assigned to type

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::update (   $typeId,
  $status,
UpdateStruct  $contentType 
)
Parameters
mixed$typeId
int$status
\eZ\Publish\SPI\Persistence\Content\Type\UpdateStruct$contentType
Returns
Type
eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::updateFieldDefinition (   $contentTypeId,
  $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
\eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition$fieldDefinition
Returns
void

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::updateGroup ( GroupUpdateStruct  $struct)
Parameters
\eZ\Publish\SPI\Persistence\Content\Type\Group\UpdateStruct$struct
Returns

Implements eZ\Publish\SPI\Persistence\Content\Type\Handler.

Member Data Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::$contentTypeGateway
protected
eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::$mapper
protected
eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::$updateHandler
protected

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