eZPublishCommunityProject  2013.5
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion Class Reference

Base class for content gateways. More...

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

Public Member Functions

 __construct (Gateway $innerGateway)
 Creates a new exception conversion gateway around $innerGateway. More...
 
 deleteContent ($contentId)
 Deletes the actual content object referred to by $contentId. More...
 
 deleteField ($fieldId, $version)
 Deletes the field with the given $fieldId. More...
 
 deleteFields ($contentId, $versionNo=null)
 Deletes all fields of $contentId in all versions. More...
 
 deleteNames ($contentId, $versionNo=null)
 Deletes all names of $contentId. More...
 
 deleteRelation ($relationId, $type)
 Deletes the relation with the given $relationId. More...
 
 deleteRelations ($contentId, $versionNo=null)
 Deletes relations to and from $contentId. More...
 
 deleteVersions ($contentId, $versionNo=null)
 Deletes all versions of $contentId. More...
 
 getAllLocationIds ($contentId)
 Returns all IDs for locations that refer to $contentId. More...
 
 getContext ()
 Get context definition for external storage layers. More...
 
 getFieldIdsByType ($contentId, $versionNo=null)
 Returns all field IDs of $contentId grouped by their type. More...
 
 getLastVersionNumber ($contentId)
 Returns last version number for content identified by $contentId. More...
 
 insertContentObject (CreateStruct $struct, $currentVersionNo=1)
 Inserts a new content object. More...
 
 insertExistingField (Content $content, Field $field, StorageFieldValue $value)
 Inserts an existing field. More...
 
 insertNewField (Content $content, Field $field, StorageFieldValue $value)
 Inserts a new field. More...
 
 insertRelation (RelationCreateStruct $struct)
 Inserts a new relation database record. More...
 
 insertVersion (VersionInfo $versionInfo, array $fields)
 Inserts a new version. More...
 
 listVersions ($contentId)
 Returns all version data for the given $contentId. More...
 
 listVersionsForUser ($userId, $status=VersionInfo::STATUS_DRAFT)
 Returns data for all versions with given status created by the given $userId. More...
 
 load ($contentId, $version, $translations=null)
 Loads data for a content object. More...
 
 loadContentInfo ($contentId)
 Loads info for content identified by $contentId. More...
 
 loadLatestPublishedData ($contentId)
 Loads data for the latest published version of the content identified by $contentId. More...
 
 loadRelations ($contentId, $contentVersionNo=null, $relationType=null)
 Loads data of related to/from $contentId. More...
 
 loadReverseRelations ($contentId, $relationType=null)
 Loads data of related to/from $contentId. More...
 
 loadVersionInfo ($contentId, $versionNo)
 Loads version info for content identified by $contentId and $versionNo. More...
 
 setName ($contentId, $version, $name, $language)
 Sets the content object name. More...
 
 setStatus ($contentId, $version, $status)
 Sets the state of object identified by $contentId and $version to $state. More...
 
 updateAlwaysAvailableFlag ($contentId, $newAlwaysAvailable)
 Updates "always available" flag for content identified by $contentId, in respect to $alwaysAvailable. More...
 
 updateContent ($contentId, MetadataUpdateStruct $struct)
 Updates an existing content identified by $contentId in respect to $struct. More...
 
 updateField (Field $field, StorageFieldValue $value)
 Updates an existing field. More...
 
 updateNonTranslatableField (Field $field, StorageFieldValue $value, $contentId)
 Updates an existing, non-translatable field. More...
 
 updateVersion ($contentId, $versionNo, UpdateStruct $struct)
 Updates version $versionNo for content identified by $contentId, in respect to $struct. More...
 
- Public Member Functions inherited from eZ\Publish\Core\Persistence\Legacy\Content\Gateway
 deleteContent ($contentId)
 Deletes the actual content object referred to by $contentId. More...
 
 deleteField ($fieldId, $version)
 Deletes the field with the given $fieldId. More...
 
 deleteFields ($contentId, $versionNo=null)
 Deletes all fields of $contentId in all versions. More...
 
 deleteNames ($contentId, $versionNo=null)
 Deletes all names of $contentId. More...
 
 deleteRelation ($relationId, $type)
 Deletes the relation with the given $relationId. More...
 
 deleteRelations ($contentId, $versionNo=null)
 Deletes relations to and from $contentId. More...
 
 deleteVersions ($contentId, $versionNo=null)
 Deletes all versions of $contentId. More...
 
 getAllLocationIds ($contentId)
 Returns all IDs for locations that refer to $contentId. More...
 
 getContext ()
 Get context definition for external storage layers. More...
 
 getFieldIdsByType ($contentId, $versionNo=null)
 Returns all field IDs of $contentId grouped by their type. More...
 
 getLastVersionNumber ($contentId)
 Returns last version number for content identified by $contentId. More...
 
 insertContentObject (CreateStruct $struct, $currentVersionNo=1)
 Inserts a new content object. More...
 
 insertExistingField (Content $content, Field $field, StorageFieldValue $value)
 Inserts an existing field. More...
 
 insertNewField (Content $content, Field $field, StorageFieldValue $value)
 Inserts a new field. More...
 
 insertRelation (RelationCreateStruct $createStruct)
 Inserts a new relation database record. More...
 
 insertVersion (VersionInfo $versionInfo, array $fields)
 Inserts a new version. More...
 
 listVersions ($contentId)
 Returns all version data for the given $contentId. More...
 
 listVersionsForUser ($userId, $status=VersionInfo::STATUS_DRAFT)
 Returns data for all versions with given status created by the given $userId. More...
 
 load ($contentId, $version, $translations=null)
 Loads data for a content object. More...
 
 loadContentInfo ($contentId)
 Loads info for content identified by $contentId. More...
 
 loadLatestPublishedData ($contentId)
 Loads data for the latest published version of the content identified by $contentId. More...
 
 loadRelations ($contentId, $contentVersionNo=null, $relationType=null)
 Loads data of related to/from $contentId. More...
 
 loadReverseRelations ($contentId, $relationType=null)
 Loads data of related to/from $contentId. More...
 
 loadVersionInfo ($contentId, $versionNo)
 Loads version info for content identified by $contentId and $versionNo. More...
 
 setName ($contentId, $version, $name, $language)
 Sets the content object name. More...
 
 setStatus ($contentId, $version, $status)
 Sets the state of object identified by $contentId and $version to $state. More...
 
 updateAlwaysAvailableFlag ($contentId, $newAlwaysAvailable)
 Updates "always available" flag for content identified by $contentId, in respect to $alwaysAvailable. More...
 
 updateContent ($contentId, MetadataUpdateStruct $struct)
 Updates an existing content identified by $contentId in respect to $struct. More...
 
 updateField (Field $field, StorageFieldValue $value)
 Updates an existing field. More...
 
 updateNonTranslatableField (Field $field, StorageFieldValue $value, $contentId)
 Updates an existing, non-translatable field. More...
 
 updateVersion ($contentId, $versionNo, UpdateStruct $struct)
 Updates version $versionNo for content identified by $contentId, in respect to $struct. More...
 

Protected Attributes

 $innerGateway
 

Detailed Description

Base class for content gateways.

Constructor & Destructor Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::__construct ( Gateway  $innerGateway)

Creates a new exception conversion gateway around $innerGateway.

Parameters
Gateway$innerGateway

Member Function Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::deleteContent (   $contentId)

Deletes the actual content object referred to by $contentId.

Parameters
int$contentId
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::deleteField (   $fieldId,
  $version 
)

Deletes the field with the given $fieldId.

Parameters
int$fieldId
int$version
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::deleteFields (   $contentId,
  $versionNo = null 
)

Deletes all fields of $contentId in all versions.

If $versionNo is set only fields for that version are deleted.

Parameters
int$contentId
int | null$versionNo
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::deleteNames (   $contentId,
  $versionNo = null 
)

Deletes all names of $contentId.

If $versionNo is set only names for that version are deleted.

Parameters
int$contentId
int | null$versionNo
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::deleteRelation (   $relationId,
  $type 
)

Deletes the relation with the given $relationId.

Parameters
int$relationId
int$type{
See Also
::COMMON, ::EMBED, ::LINK, ::FIELD}
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::deleteRelations (   $contentId,
  $versionNo = null 
)

Deletes relations to and from $contentId.

If $versionNo is set only relations for that version are deleted.

Parameters
int$contentId
int | null$versionNo
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::deleteVersions (   $contentId,
  $versionNo = null 
)

Deletes all versions of $contentId.

If $versionNo is set only that version is deleted.

Parameters
int$contentId
int | null$versionNo
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::getAllLocationIds (   $contentId)

Returns all IDs for locations that refer to $contentId.

Parameters
int$contentId
Returns
int[]
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::getContext ( )

Get context definition for external storage layers.

Returns
array
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::getFieldIdsByType (   $contentId,
  $versionNo = null 
)

Returns all field IDs of $contentId grouped by their type.

If $versionNo is set only field IDs for that version are returned.

Parameters
int$contentId
int | null$versionNo
Returns
int[][]
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::getLastVersionNumber (   $contentId)

Returns last version number for content identified by $contentId.

Parameters
int$contentId
Returns
int
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::insertContentObject ( CreateStruct  $struct,
  $currentVersionNo = 1 
)

Inserts a new content object.

Parameters
\eZ\Publish\SPI\Persistence\Content\CreateStruct$struct
mixed$currentVersionNo
Returns
int ID
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::insertExistingField ( Content  $content,
Field  $field,
StorageFieldValue  $value 
)

Inserts an existing field.

Used to insert a field with an exsting ID but a new version number.

Parameters
Content$content
Field$field
StorageFieldValue$value
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::insertNewField ( Content  $content,
Field  $field,
StorageFieldValue  $value 
)

Inserts a new field.

Only used when a new field is created (i.e. a new object or a field in a new language!). After that, field IDs need to stay the same, only the version number changes.

Parameters
\eZ\Publish\SPI\Persistence\Content$content
\eZ\Publish\SPI\Persistence\Content\Field$field
\eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldValue$value
Returns
int ID
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::insertRelation ( RelationCreateStruct  $struct)

Inserts a new relation database record.

Parameters
\eZ\Publish\SPI\Persistence\Content\Relation\CreateStruct$createStruct
Returns
int ID the inserted ID
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::insertVersion ( VersionInfo  $versionInfo,
array  $fields 
)

Inserts a new version.

Parameters
\eZ\Publish\SPI\Persistence\Content\VersionInfo$versionInfo
\eZ\Publish\SPI\Persistence\Content\Field[]$fields
Returns
int ID
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::listVersions (   $contentId)

Returns all version data for the given $contentId.

Parameters
mixed$contentId
Returns
string[][]
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::listVersionsForUser (   $userId,
  $status = VersionInfo::STATUS_DRAFT 
)

Returns data for all versions with given status created by the given $userId.

Parameters
int$userId
int$status
Returns
string[][]
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::load (   $contentId,
  $version,
  $translations = null 
)

Loads data for a content object.

Returns an array with the relevant data.

Parameters
mixed$contentId
mixed$version
string[]$translations
Returns
array
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::loadContentInfo (   $contentId)

Loads info for content identified by $contentId.

Will basically return a hash containing all field values for ezcontentobject table plus following keys:

  • always_available => Boolean indicating if content's language mask contains alwaysAvailable bit field
  • main_language_code => Language code for main (initial) language. E.g. "eng-GB"
Parameters
int$contentId
Exceptions
\eZ\Publish\Core\Base\Exceptions\NotFoundException
Returns
array
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::loadLatestPublishedData (   $contentId)

Loads data for the latest published version of the content identified by $contentId.

Parameters
mixed$contentId
Returns
array
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::loadRelations (   $contentId,
  $contentVersionNo = null,
  $relationType = null 
)

Loads data of related to/from $contentId.

Parameters
int$contentId
int$contentVersionNo
int$relationType
Returns
mixed[][] Content data, array structured like {
See Also
::load()}
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::loadReverseRelations (   $contentId,
  $relationType = null 
)

Loads data of related to/from $contentId.

Parameters
int$contentId
boolean$reverseReverse relation, default false
int$contentVersionNo
int$relationType
Returns
mixed[][] Content data, array structured like {
See Also
::load()}
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::loadVersionInfo (   $contentId,
  $versionNo 
)

Loads version info for content identified by $contentId and $versionNo.

Will basically return a hash containing all field values from ezcontentobject_version table plus following keys:

  • names => Hash of content object names. Key is the language code, value is the name.
  • languages => Hash of language ids. Key is the language code (e.g. "eng-GB"), value is the language numeric id without the always available bit.
  • initial_language_code => Language code for initial language in this version.
Parameters
int$contentId
int$versionNo
Returns
array
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::setName (   $contentId,
  $version,
  $name,
  $language 
)

Sets the content object name.

Parameters
int$contentId
int$version
string$name
string$language
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::setStatus (   $contentId,
  $version,
  $status 
)

Sets the state of object identified by $contentId and $version to $state.

The $status can be one of STATUS_DRAFT, STATUS_PUBLISHED, STATUS_ARCHIVED

Parameters
int$contentId
int$version
int$status
Returns
boolean
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::updateAlwaysAvailableFlag (   $contentId,
  $newAlwaysAvailable 
)

Updates "always available" flag for content identified by $contentId, in respect to $alwaysAvailable.

Parameters
int$contentId
boolean$newAlwaysAvailableNew "always available" value
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::updateContent (   $contentId,
MetadataUpdateStruct  $struct 
)

Updates an existing content identified by $contentId in respect to $struct.

Parameters
int$contentId
\eZ\Publish\SPI\Persistence\Content\MetadataUpdateStruct$struct
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::updateField ( Field  $field,
StorageFieldValue  $value 
)

Updates an existing field.

Parameters
Field$field
StorageFieldValue$value
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::updateNonTranslatableField ( Field  $field,
StorageFieldValue  $value,
  $contentId 
)

Updates an existing, non-translatable field.

Parameters
\eZ\Publish\SPI\Persistence\Content\Field$field
\eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldValue$value
int$contentId
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::updateVersion (   $contentId,
  $versionNo,
UpdateStruct  $struct 
)

Updates version $versionNo for content identified by $contentId, in respect to $struct.

Parameters
int$contentId
int$versionNo
\eZ\Publish\SPI\Persistence\Content\UpdateStruct$struct
Returns
void

Member Data Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion::$innerGateway
protected

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