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

Public Member Functions

 __construct (BaseContentTypeHandler $handler)
 Creates a new content type handler. More...
 
 addFieldDefinition ($contentTypeId, $status, FieldDefinition $fieldDefinition)
 Adds a new field definition to an existing Type. More...
 
 clearCache ()
 Clear internal caches. 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)
 Load a (defined) content type by identifier. More...
 
 loadByRemoteId ($remoteId)
 Load 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

 loadFromRows (array $rows, $typeIdentifier, $status)
 Loads a single Type from $rows. More...
 

Protected Attributes

 $contentTypes
 
 $fieldDefinitions
 
 $groups
 
 $innerHandler
 

Constructor & Destructor Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler::__construct ( BaseContentTypeHandler  $handler)

Creates a new content type handler.

Parameters
\eZ\Publish\SPI\Persistence\Content\Type\Handler$handler

Member Function Documentation

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

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

eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler::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\MemoryCachingHandler::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\MemoryCachingHandler::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\MemoryCachingHandler::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\MemoryCachingHandler::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\MemoryCachingHandler::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\MemoryCachingHandler::loadAllGroups ( )
eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler::loadByIdentifier (   $identifier)

Load a (defined) content type by identifier.

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

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

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

Load a (defined) content type by remote id.

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

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

eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler::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\MemoryCachingHandler::loadFromRows ( array  $rows,
  $typeIdentifier,
  $status 
)
protected

Loads a single Type from $rows.

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

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

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

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

eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler::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\MemoryCachingHandler::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\MemoryCachingHandler::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\MemoryCachingHandler::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\MemoryCachingHandler::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\MemoryCachingHandler::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\MemoryCachingHandler::$contentTypes
protected
eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler::$fieldDefinitions
protected
eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler::$groups
protected
eZ\Publish\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler::$innerHandler
protected

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