eZPublishCommunityProject  2013.9
eZ\Publish\Core\Repository\DomainMapper Class Reference

DomainMapper is an internal service. More...

Public Member Functions

 __construct (RepositoryInterface $repository, Handler $contentLanguageHandler)
 Setups service with reference to repository. More...
 
 buildContentDomainObject (SPIContent $spiContent, $contentType=null)
 Builds a Content domain object from value object returned from persistence. More...
 
 buildContentInfoDomainObject (SPIContentInfo $spiContentInfo)
 Builds a ContentInfo domain object from value object returned from persistence. More...
 
 buildSPILocationCreateStruct ($locationCreateStruct, Location $parentLocation, $mainLocation, $contentId, $contentVersionNo)
 Creates an array of SPI location create structs from given array of API location create structs. More...
 
 buildVersionInfoDomainObject (SPIVersionInfo $spiVersionInfo)
 Builds a VersionInfo domain object from value object returned from persistence. More...
 
 convertVersionStatus ($spiStatus)
 Converts SPI VersionInfo::STATUS_* constant to the API VersionInfo::STATUS_* constant. More...
 
 getDateTime ($timestamp)
 Returns object from given $timestamp in environment timezone. More...
 
 getUniqueHash ($object)
 Creates unique hash string for given $object. More...
 
 isValidLocationSortField ($sortField)
 Checks if given $sortField value is one of the defined sort field constants. More...
 
 isValidLocationSortOrder ($sortOrder)
 Checks if given $sortOrder value is one of the defined sort order constants. More...
 
 validateTranslatedList ($list, $argumentName)
 Validates given translated list $list, which should be an array of strings with language codes as keys. More...
 

Protected Attributes

 $contentLanguageHandler
 
 $repository
 

Detailed Description

DomainMapper is an internal service.

Constructor & Destructor Documentation

eZ\Publish\Core\Repository\DomainMapper::__construct ( RepositoryInterface  $repository,
Handler  $contentLanguageHandler 
)

Setups service with reference to repository.

Parameters
\eZ\Publish\API\Repository\Repository$repository
\eZ\Publish\SPI\Persistence\Content\Language\Handler$contentLanguageHandler

Member Function Documentation

eZ\Publish\Core\Repository\DomainMapper::buildContentDomainObject ( SPIContent  $spiContent,
  $contentType = null 
)

Builds a Content domain object from value object returned from persistence.

Parameters
\eZ\Publish\SPI\Persistence\Content$spiContent
\eZ\Publish\API\Repository\Values\ContentType\ContentType$contentType
Returns
eZ\Publish\Core\Repository\DomainMapper::buildContentInfoDomainObject ( SPIContentInfo  $spiContentInfo)

Builds a ContentInfo domain object from value object returned from persistence.

Parameters
\eZ\Publish\SPI\Persistence\Content\ContentInfo$spiContentInfo
Returns

Referenced by eZ\Publish\Core\Repository\DomainMapper\buildVersionInfoDomainObject().

eZ\Publish\Core\Repository\DomainMapper::buildSPILocationCreateStruct (   $locationCreateStruct,
Location  $parentLocation,
  $mainLocation,
  $contentId,
  $contentVersionNo 
)

Creates an array of SPI location create structs from given array of API location create structs.

Exceptions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
Parameters
\eZ\Publish\API\Repository\Values\Content\LocationCreateStruct$locationCreateStruct
\eZ\Publish\API\Repository\Values\Content\Location$parentLocation
mixed$mainLocation
mixed$contentId
mixed$contentVersionNo
Returns
eZ\Publish\Core\Repository\DomainMapper::buildVersionInfoDomainObject ( SPIVersionInfo  $spiVersionInfo)

Builds a VersionInfo domain object from value object returned from persistence.

Parameters
\eZ\Publish\SPI\Persistence\Content\VersionInfo$spiVersionInfo
Returns
eZ\Publish\Core\Repository\DomainMapper::convertVersionStatus (   $spiStatus)

Converts SPI VersionInfo::STATUS_* constant to the API VersionInfo::STATUS_* constant.

Parameters
mixed$spiStatus
Returns
mixed

Referenced by eZ\Publish\Core\Repository\DomainMapper\buildVersionInfoDomainObject().

eZ\Publish\Core\Repository\DomainMapper::getDateTime (   $timestamp)

Returns object from given $timestamp in environment timezone.

This method is needed because constructing with $timestamp will return the object in UTC timezone.

Parameters
int$timestamp
Returns

Referenced by eZ\Publish\Core\Repository\DomainMapper\buildContentInfoDomainObject(), and eZ\Publish\Core\Repository\DomainMapper\buildVersionInfoDomainObject().

eZ\Publish\Core\Repository\DomainMapper::getUniqueHash (   $object)

Creates unique hash string for given $object.

Used for remoteId.

Parameters
object$object
Returns
string

Referenced by eZ\Publish\Core\Repository\DomainMapper\buildSPILocationCreateStruct().

eZ\Publish\Core\Repository\DomainMapper::isValidLocationSortField (   $sortField)

Checks if given $sortField value is one of the defined sort field constants.

Parameters
mixed$sortField
Returns
bool
eZ\Publish\Core\Repository\DomainMapper::isValidLocationSortOrder (   $sortOrder)

Checks if given $sortOrder value is one of the defined sort order constants.

Parameters
mixed$sortOrder
Returns
bool
eZ\Publish\Core\Repository\DomainMapper::validateTranslatedList (   $list,
  $argumentName 
)

Validates given translated list $list, which should be an array of strings with language codes as keys.

Exceptions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
Parameters
mixed$list
string$argumentName
Returns
void

Member Data Documentation

eZ\Publish\Core\Repository\DomainMapper::$contentLanguageHandler
protected
eZ\Publish\Core\Repository\DomainMapper::$repository
protected

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