PHP Interface Sulu\Component\Content\Mapper\ContentMapperInterface

Exibir arquivo Open project: sulu/sulu Interface Usage Examples

Public Methods

Method Description
convertQueryResultToArray ( PHPCR\Query\QueryResultInterface $queryResult, string $webspaceKey, string[] $locales, array $fields, integer $maxDepth, $onlyPublished = true ) : array Converts a query result in a list of arrays.
copyLanguage ( string $uuid, $userId, $webspaceKey, $srcLanguageCode, $destLanguageCodes ) : Sulu\Component\Content\Compat\StructureInterface Copies the content from one node from one localization to the other.
delete ( string $uuid, string $webspaceKey ) deletes content with subcontent in given webspace.
load ( string $uuid, string $webspaceKey, string $languageCode, boolean $loadGhostContent = false ) : Sulu\Component\Content\Compat\StructureInterface returns the data from the given id.
loadBreadcrumb ( $uuid, $languageCode, $webspaceKey ) : Sulu\Component\Content\BreadcrumbItemInterface[] load breadcrumb for given uuid in given language.
loadByNode ( PHPCR\NodeInterface $contentNode, $localization, string $webspaceKey = null, boolean $excludeGhost = true, boolean $loadGhostContent = false, boolean $excludeShadow = true ) returns the data for the given node.
loadByParent ( string $uuid, string $webspaceKey, string $languageCode, integer $depth = 1, boolean $flat = true, boolean $ignoreExceptions = false, boolean $excludeGhosts = false ) : Sulu\Component\Content\Compat\StructureInterface[] returns a list of data from children of given node.
loadByQuery ( PHPCR\Query\QueryInterface $query, string $languageCode, string $webspaceKey, boolean $excludeGhost = true, boolean $loadGhostContent = false ) : Sulu\Component\Content\Compat\StructureInterface[] load Structures for the given QOM\QueryInterface instance.
loadBySql2 ( string $sql2, string $languageCode, string $webspaceKey, integer $limit = null ) : Sulu\Component\Content\Compat\StructureInterface[] returns the content returned by the given sql2 query as structures.
loadStartPage ( string $webspaceKey, string $languageCode ) : Sulu\Component\Content\Compat\StructureInterface returns the data from the given id.
orderAt ( string $uuid, integer $position, integer $userId, string $webspaceKey, string $languageCode ) : Sulu\Component\Content\Compat\StructureInterface brings a node with a given uuid into a given position.
orderBefore ( string $uuid, string $beforeUuid, integer $userId, string $webspaceKey, string $languageCode ) : Sulu\Component\Content\Compat\StructureInterface order node with uuid before the node with beforeUuid !IMPORTANT! both nodes should have the same parent.
saveExtension ( string $uuid, array $data, string $extensionName, string $webspaceKey, string $languageCode, integer $userId ) : Sulu\Component\Content\Compat\StructureInterface save a extension with given name and data to an existing node.

Method Details

convertQueryResultToArray() public method

Converts a query result in a list of arrays.
public convertQueryResultToArray ( PHPCR\Query\QueryResultInterface $queryResult, string $webspaceKey, string[] $locales, array $fields, integer $maxDepth, $onlyPublished = true ) : array
$queryResult PHPCR\Query\QueryResultInterface
$webspaceKey string
$locales string[]
$fields array
$maxDepth integer
return array

copyLanguage() public method

Copies the content from one node from one localization to the other.
public copyLanguage ( string $uuid, $userId, $webspaceKey, $srcLanguageCode, $destLanguageCodes ) : Sulu\Component\Content\Compat\StructureInterface
$uuid string
$userId
$webspaceKey
$srcLanguageCode
$destLanguageCodes
return Sulu\Component\Content\Compat\StructureInterface

delete() public method

deletes content with subcontent in given webspace.
public delete ( string $uuid, string $webspaceKey )
$uuid string UUID of content
$webspaceKey string Key of webspace

load() public method

returns the data from the given id.
public load ( string $uuid, string $webspaceKey, string $languageCode, boolean $loadGhostContent = false ) : Sulu\Component\Content\Compat\StructureInterface
$uuid string UUID of the content
$webspaceKey string Key of webspace
$languageCode string Read data for given language
$loadGhostContent boolean True if also a ghost page should be returned, otherwise false
return Sulu\Component\Content\Compat\StructureInterface

loadBreadcrumb() public method

load breadcrumb for given uuid in given language.
Deprecation:
public loadBreadcrumb ( $uuid, $languageCode, $webspaceKey ) : Sulu\Component\Content\BreadcrumbItemInterface[]
$uuid
$languageCode
$webspaceKey
return Sulu\Component\Content\BreadcrumbItemInterface[]

loadByNode() public method

returns the data for the given node.
public loadByNode ( PHPCR\NodeInterface $contentNode, $localization, string $webspaceKey = null, boolean $excludeGhost = true, boolean $loadGhostContent = false, boolean $excludeShadow = true )
$contentNode PHPCR\NodeInterface The node for which to load the data
$webspaceKey string Key of the webspace
$excludeGhost boolean Do not return Ghost structures (return null instead)
$loadGhostContent boolean Load ghost content
$excludeShadow boolean Do not return shadow structures (return null instead)

loadByParent() public method

returns a list of data from children of given node.
public loadByParent ( string $uuid, string $webspaceKey, string $languageCode, integer $depth = 1, boolean $flat = true, boolean $ignoreExceptions = false, boolean $excludeGhosts = false ) : Sulu\Component\Content\Compat\StructureInterface[]
$uuid string The uuid of the parent node
$webspaceKey string The key of the webspace we are loading in
$languageCode string The requested content language
$depth integer The depth of the search
$flat boolean If true, the result is a flat list
$ignoreExceptions boolean
$excludeGhosts boolean If true ghost pages are also loaded
return Sulu\Component\Content\Compat\StructureInterface[]

loadByQuery() public method

load Structures for the given QOM\QueryInterface instance.
public loadByQuery ( PHPCR\Query\QueryInterface $query, string $languageCode, string $webspaceKey, boolean $excludeGhost = true, boolean $loadGhostContent = false ) : Sulu\Component\Content\Compat\StructureInterface[]
$query PHPCR\Query\QueryInterface The query, which returns the content
$languageCode string The language code
$webspaceKey string The webspace key
$excludeGhost boolean
$loadGhostContent boolean
return Sulu\Component\Content\Compat\StructureInterface[]

loadBySql2() public method

returns the content returned by the given sql2 query as structures.
public loadBySql2 ( string $sql2, string $languageCode, string $webspaceKey, integer $limit = null ) : Sulu\Component\Content\Compat\StructureInterface[]
$sql2 string The query, which returns the content
$languageCode string The language code
$webspaceKey string The webspace key
$limit integer Limits the number of returned rows
return Sulu\Component\Content\Compat\StructureInterface[]

loadStartPage() public method

returns the data from the given id.
public loadStartPage ( string $webspaceKey, string $languageCode ) : Sulu\Component\Content\Compat\StructureInterface
$webspaceKey string Key of webspace
$languageCode string Read data for given language
return Sulu\Component\Content\Compat\StructureInterface

orderAt() public method

brings a node with a given uuid into a given position.
public orderAt ( string $uuid, integer $position, integer $userId, string $webspaceKey, string $languageCode ) : Sulu\Component\Content\Compat\StructureInterface
$uuid string
$position integer
$userId integer
$webspaceKey string
$languageCode string
return Sulu\Component\Content\Compat\StructureInterface

orderBefore() public method

order node with uuid before the node with beforeUuid !IMPORTANT! both nodes should have the same parent.
public orderBefore ( string $uuid, string $beforeUuid, integer $userId, string $webspaceKey, string $languageCode ) : Sulu\Component\Content\Compat\StructureInterface
$uuid string
$beforeUuid string
$userId integer
$webspaceKey string
$languageCode string
return Sulu\Component\Content\Compat\StructureInterface

saveExtension() public method

save a extension with given name and data to an existing node.
public saveExtension ( string $uuid, array $data, string $extensionName, string $webspaceKey, string $languageCode, integer $userId ) : Sulu\Component\Content\Compat\StructureInterface
$uuid string
$data array
$extensionName string
$webspaceKey string
$languageCode string
$userId integer
return Sulu\Component\Content\Compat\StructureInterface