eZPublishCommunityProject  2013.6
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase Class Reference

Zeta Component Database based content type gateway. More...

+ Inheritance diagram for eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase:
+ Collaboration diagram for eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase:

Public Member Functions

 __construct (EzcDbHandler $db, MaskGenerator $languageMaskGenerator)
 Creates a new gateway based on $db. More...
 
 countGroupsForType ($typeId, $status)
 Returns the number of Groups the type is assigned to. More...
 
 countInstancesOfType ($typeId)
 Counts the number of instances that exists of the identified type. More...
 
 countTypesInGroup ($groupId)
 Returns the number of types in a certain group. More...
 
 delete ($typeId, $status)
 Deletes a Type completely. More...
 
 deleteFieldDefinition ($typeId, $status, $fieldDefinitionId)
 Deletes a field definition. More...
 
 deleteFieldDefinitionsForType ($typeId, $status)
 Deletes all field definitions of a Type. More...
 
 deleteGroup ($groupId)
 Deletes the Group with the given $groupId. More...
 
 deleteGroupAssignment ($groupId, $typeId, $status)
 Deletes a group assignments for a Type. More...
 
 deleteGroupAssignmentsForType ($typeId, $status)
 Deletes all group assignments for a Type. More...
 
 deleteType ($typeId, $status)
 Deletes a the Type. More...
 
 insertFieldDefinition ($typeId, $status, FieldDefinition $fieldDefinition, StorageFieldDefinition $storageFieldDef)
 Inserts a $fieldDefinition for $typeId. More...
 
 insertGroup (Group $group)
 Inserts the given $group. More...
 
 insertGroupAssignment ($groupId, $typeId, $status)
 Insert assignment of $typeId to $groupId. More...
 
 insertType (Type $type, $typeId=null)
 Inserts a new content type. More...
 
 loadAllGroupsData ()
 Returns an array with data about all Group objects. More...
 
 loadFieldDefinition ($id, $status)
 Loads an array with data about field definition referred $id and $status. More...
 
 loadGroupData ($groupId)
 Loads data about Group with $groupId. More...
 
 loadGroupDataByIdentifier ($identifier)
 Loads data about Group with $identifier. More...
 
 loadTypeData ($typeId, $status)
 Loads an array with data about $typeId in $status. More...
 
 loadTypeDataByIdentifier ($identifier, $status)
 Loads an array with data about the type referred to by $identifier in $status. More...
 
 loadTypeDataByRemoteId ($remoteId, $status)
 Loads an array with data about the type referred to by $remoteId in $status. More...
 
 loadTypesDataForGroup ($groupId, $status)
 Loads data for all Types in $status in $groupId. More...
 
 publishTypeAndFields ($typeId, $sourceVersion, $targetVersion)
 Publishes the Type with $typeId from $sourceVersion to $targetVersion, including its fields. More...
 
 updateFieldDefinition ($typeId, $status, FieldDefinition $fieldDefinition, StorageFieldDefinition $storageFieldDef)
 Updates a $fieldDefinition for $typeId. More...
 
 updateGroup (GroupUpdateStruct $group)
 Updates a group with data in $group. More...
 
 updateType ($typeId, $status, UpdateStruct $updateStruct)
 Update a type with $updateStruct. More...
 
- Public Member Functions inherited from eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway
 countGroupsForType ($typeId, $status)
 Returns the number of Groups the type is assigned to. More...
 
 countInstancesOfType ($typeId)
 Counts the number of instances that exists of the identified type. More...
 
 countTypesInGroup ($groupId)
 Returns the number of types in a certain group. More...
 
 delete ($typeId, $status)
 Deletes a Type completely. More...
 
 deleteFieldDefinition ($typeId, $status, $fieldDefinitionId)
 Deletes a field definition. More...
 
 deleteFieldDefinitionsForType ($typeId, $status)
 Deletes all field definitions of a Type. More...
 
 deleteGroup ($groupId)
 Deletes the Group with the given $groupId. More...
 
 deleteGroupAssignment ($groupId, $typeId, $status)
 Deletes a group assignments for a Type. More...
 
 deleteGroupAssignmentsForType ($typeId, $status)
 Deletes all group assignments for a Type. More...
 
 deleteType ($typeId, $status)
 Deletes a the Type. More...
 
 insertFieldDefinition ($typeId, $status, FieldDefinition $fieldDefinition, StorageFieldDefinition $storageFieldDef)
 Inserts a $fieldDefinition for $typeId. More...
 
 insertGroup (Group $group)
 Inserts the given $group. More...
 
 insertGroupAssignment ($typeId, $status, $groupId)
 Insert assignment of $typeId to $groupId. More...
 
 insertType (Type $type, $typeId=null)
 Inserts a new content type. More...
 
 loadAllGroupsData ()
 Returns an array with data about all Group objects. More...
 
 loadFieldDefinition ($id, $status)
 Loads an array with data about field definition referred $id and $status. More...
 
 loadGroupData ($groupId)
 Returns an array with data about the Group with $groupId. More...
 
 loadGroupDataByIdentifier ($identifier)
 Returns an array with data about the Group with $identifier. More...
 
 loadTypeData ($typeId, $status)
 Loads an array with data about $typeId in $status. More...
 
 loadTypeDataByIdentifier ($identifier, $status)
 Loads an array with data about the type referred to by $identifier in $status. More...
 
 loadTypeDataByRemoteId ($remoteId, $status)
 Loads an array with data about the type referred to by $remoteId in $status. More...
 
 loadTypesDataForGroup ($groupId, $status)
 Loads data for all Types in $status in $groupId. More...
 
 publishTypeAndFields ($typeId, $sourceStatus, $targetStatus)
 Publishes the Type with $typeId from $sourceVersion to $targetVersion, including its fields. More...
 
 updateFieldDefinition ($typeId, $status, FieldDefinition $fieldDefinition, StorageFieldDefinition $storageFieldDef)
 Updates a $fieldDefinition for $typeId. More...
 
 updateGroup (GroupUpdateStruct $group)
 Updates a group with data in $group. More...
 
 updateType ($typeId, $status, UpdateStruct $updateStruct)
 Update a type with $updateStruct. More...
 

Protected Member Functions

 createGroupLoadQuery ()
 Creates the basic query to load Group data. More...
 
 deleteTypeNameData ($typeId, $typeStatus)
 Deletes all name data for $typeId in $typeStatus. More...
 
 getLoadTypeQuery ()
 Returns a basic query to retrieve Type data. More...
 
 insertTypeNameData ($typeId, $typeStatus, array $languages)
 Inserts data into contentclass_name. More...
 
 selectColumns (ezcQuerySelect $q, $tableName)
 Creates an array of select columns for $tableName. More...
 
 setCommonFieldColumns (ezcQuery $q, FieldDefinition $fieldDefinition, StorageFieldDefinition $storageFieldDef)
 Set common columns for insert/update of FieldDefinition. More...
 
 setCommonTypeColumns (ezcQuery $q, $type)
 Set common columns for insert/update of a Type. More...
 

Protected Attributes

 $columns
 
 $dbHandler
 
 $languageMaskGenerator
 

Detailed Description

Zeta Component Database based content type gateway.

Constructor & Destructor Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::__construct ( EzcDbHandler  $db,
MaskGenerator  $languageMaskGenerator 
)

Creates a new gateway based on $db.

Parameters
\eZ\Publish\Core\Persistence\Legacy\EzcDbHandler$db
\eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator$languageMaskGenerator

Member Function Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::countGroupsForType (   $typeId,
  $status 
)

Returns the number of Groups the type is assigned to.

Parameters
int$typeId
int$status
Returns
int
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::countInstancesOfType (   $typeId)

Counts the number of instances that exists of the identified type.

Parameters
int$typeId
Returns
int
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::countTypesInGroup (   $groupId)

Returns the number of types in a certain group.

Parameters
int$groupId
Returns
int
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::createGroupLoadQuery ( )
protected
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::delete (   $typeId,
  $status 
)

Deletes a Type completely.

Parameters
mixed$typeId
int$status
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::deleteFieldDefinition (   $typeId,
  $status,
  $fieldDefinitionId 
)

Deletes a field definition.

Parameters
mixed$typeId
int$status
mixed$fieldDefinitionId
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::deleteFieldDefinitionsForType (   $typeId,
  $status 
)

Deletes all field definitions of a Type.

Parameters
mixed$typeId
int$status
Returns
void

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase\delete().

eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::deleteGroup (   $groupId)

Deletes the Group with the given $groupId.

Parameters
int$groupId
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::deleteGroupAssignment (   $groupId,
  $typeId,
  $status 
)

Deletes a group assignments for a Type.

Parameters
mixed$groupId
mixed$typeId
int$status
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::deleteGroupAssignmentsForType (   $typeId,
  $status 
)

Deletes all group assignments for a Type.

Parameters
mixed$typeId
int$status
Returns
void

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase\delete().

eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::deleteType (   $typeId,
  $status 
)

Deletes a the Type.

Does no delete the field definitions!

Parameters
mixed$typeId
int$status
Returns
void

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase\delete().

eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::deleteTypeNameData (   $typeId,
  $typeStatus 
)
protected

Deletes all name data for $typeId in $typeStatus.

Parameters
int$typeId
int$typeStatus
Returns
void

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase\delete(), and eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase\updateType().

eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::insertFieldDefinition (   $typeId,
  $status,
FieldDefinition  $fieldDefinition,
StorageFieldDefinition  $storageFieldDef 
)

Inserts a $fieldDefinition for $typeId.

Parameters
mixed$typeId
int$status
\eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition$fieldDefinition
\eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition$storageFieldDef
Returns
mixed Field definition ID
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::insertGroup ( Group  $group)

Inserts the given $group.

Parameters
\eZ\Publish\SPI\Persistence\Content\Type\Group$group
Returns
mixed Group ID
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::insertGroupAssignment (   $groupId,
  $typeId,
  $status 
)

Insert assignment of $typeId to $groupId.

Parameters
mixed$groupId
mixed$typeId
int$status
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::insertType ( Type  $type,
  $typeId = null 
)

Inserts a new content type.

Parameters
\eZ\Publish\SPI\Persistence\Content\Type$type
mixed | null$typeId
Returns
mixed Type ID
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::insertTypeNameData (   $typeId,
  $typeStatus,
array  $languages 
)
protected

Inserts data into contentclass_name.

Parameters
int$typeId
int$typeStatus
string[]$languages
Returns
void

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase\insertType(), and eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase\updateType().

eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::loadAllGroupsData ( )

Returns an array with data about all Group objects.

Returns
string[][]
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::loadFieldDefinition (   $id,
  $status 
)

Loads an array with data about field definition referred $id and $status.

Parameters
mixed$idfield definition id
int$statusOne of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED
Returns
array Data rows.
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::loadGroupData (   $groupId)

Loads data about Group with $groupId.

Parameters
mixed$groupId
Returns
string[][]

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase\insertGroupAssignment().

eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::loadGroupDataByIdentifier (   $identifier)

Loads data about Group with $identifier.

Parameters
mixed$identifier
Returns
string[][]
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::loadTypeData (   $typeId,
  $status 
)

Loads an array with data about $typeId in $status.

Parameters
mixed$typeId
int$status
Returns
array Data rows.
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::loadTypeDataByIdentifier (   $identifier,
  $status 
)

Loads an array with data about the type referred to by $identifier in $status.

Parameters
string$identifier
int$status
Returns
array(int=>array(string=>mixed)) Data rows.
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::loadTypeDataByRemoteId (   $remoteId,
  $status 
)

Loads an array with data about the type referred to by $remoteId in $status.

Parameters
mixed$remoteId
int$status
Returns
array(int=>array(string=>mixed)) Data rows.
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::loadTypesDataForGroup (   $groupId,
  $status 
)

Loads data for all Types in $status in $groupId.

Parameters
mixed$groupId
int$status
Returns
string[][]
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::publishTypeAndFields (   $typeId,
  $sourceVersion,
  $targetVersion 
)

Publishes the Type with $typeId from $sourceVersion to $targetVersion, including its fields.

Parameters
int$typeId
int$sourceVersion
int$targetVersion
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::selectColumns ( ezcQuerySelect  $q,
  $tableName 
)
protected

Creates an array of select columns for $tableName.

Parameters
\ezcQuerySelect$q
string$tableName

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase\getLoadTypeQuery(), and eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase\loadFieldDefinition().

eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::setCommonFieldColumns ( ezcQuery  $q,
FieldDefinition  $fieldDefinition,
StorageFieldDefinition  $storageFieldDef 
)
protected

Set common columns for insert/update of FieldDefinition.

Parameters
\ezcQuery$q
\eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition$fieldDefinition
\eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition$storageFieldDef
Returns
void

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase\insertFieldDefinition(), and eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase\updateFieldDefinition().

eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::setCommonTypeColumns ( ezcQuery  $q,
  $type 
)
protected

Set common columns for insert/update of a Type.

Parameters
\ezcQuery$q
mixed$type
Returns
void

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase\insertType(), and eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase\updateType().

eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::updateFieldDefinition (   $typeId,
  $status,
FieldDefinition  $fieldDefinition,
StorageFieldDefinition  $storageFieldDef 
)

Updates a $fieldDefinition for $typeId.

Parameters
mixed$typeId
int$status
\eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition$fieldDefinition
\eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition$storageFieldDef
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::updateGroup ( GroupUpdateStruct  $group)

Updates a group with data in $group.

Parameters
\eZ\Publish\SPI\Persistence\Content\Type\Group\UpdateStruct$group
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::updateType (   $typeId,
  $status,
UpdateStruct  $updateStruct 
)

Update a type with $updateStruct.

Parameters
mixed$typeId
int$status
\eZ\Publish\SPI\Persistence\Content\Type\UpdateStruct$updateStruct
Returns
void

Member Data Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::$columns
protected
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::$dbHandler
protected
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\EzcDatabase::$languageMaskGenerator
protected

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