PHP Class Sulu\Component\Content\Mapper\ContentMapper

Deprecation: since 1.0-? use the DocumentManager instead
Inheritance: implements Sulu\Component\Content\Mapper\ContentMapperInterface
Datei anzeigen Open project: sulu/sulu Class Usage Examples

Public Methods

Method Description
__construct ( Sulu\Component\DocumentManager\DocumentManager $documentManager, Sulu\Component\Webspace\Manager\WebspaceManagerInterface $webspaceManager, Symfony\Component\Form\FormFactoryInterface $formFactory, DocumentInspector $inspector, PropertyEncoder $encoder, Sulu\Component\Content\Compat\StructureManagerInterface $structureManager, Sulu\Component\Content\Extension\ExtensionManagerInterface $extensionManager, Sulu\Component\Content\ContentTypeManagerInterface $contentTypeManager, Sulu\Component\PHPCR\SessionManager\SessionManagerInterface $sessionManager, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, Sulu\Component\Content\Types\ResourceLocator\Strategy\ResourceLocatorStrategyPoolInterface $resourceLocatorStrategyPool, Sulu\Component\DocumentManager\NamespaceRegistry $namespaceRegistry )
convertQueryResultToArray ( PHPCR\Query\QueryResultInterface $queryResult, $webspaceKey, $locales, $fields, $maxDepth, $onlyPublished = true )
copyLanguage ( $uuid, $userId, $webspaceKey, $srcLocale, $destLocales, $structureType = LegacyStructure::TYPE_PAGE )
delete ( $uuid, $webspaceKey )
getResourceLocator ( ) : Sulu\Component\Content\Types\ResourceLocatorInterface Return the resource locator content type.
load ( $uuid, $webspaceKey, $locale, $loadGhostContent = false )
loadBreadcrumb ( $uuid, $locale, $webspaceKey )
loadByNode ( PHPCR\NodeInterface $node, $locale, $webspaceKey = null, $excludeGhost = true, $loadGhostContent = false, $excludeShadow = true )
loadByParent ( $uuid, $webspaceKey, $languageCode, $depth = 1, $flat = true, $ignoreExceptions = false, $excludeGhosts = false )
loadByQuery ( PHPCR\Query\QueryInterface $query, $locale, $webspaceKey = null, $excludeGhost = true, $loadGhostContent = false )
loadBySql2 ( $sql2, $locale, $webspaceKey, $limit = null )
loadNodeAndAncestors ( $uuid, $locale, $webspaceKey = null, $excludeGhost = true, $excludeShadow = true )
loadShallowStructureByNode ( PHPCR\NodeInterface $contentNode, string $localization, string $webspaceKey ) : Sulu\Component\Content\Compat\StructureInterface Load/hydrate a shalow structure with the given node.
loadStartPage ( $webspaceKey, $locale )
orderAt ( $uuid, $position, $userId, $webspaceKey, $locale ) TODO: Move this logic to the DocumentManager {@inheritdoc}
orderBefore ( $uuid, $beforeUuid, $userId, $webspaceKey, $locale )
saveExtension ( $uuid, $data, $extensionName, $webspaceKey, $locale, $userId ) TODO: Refactor this .

Protected Methods

Method Description
getRootRouteNode ( $webspaceKey, string $locale, string $segment ) : PHPCR\NodeInterface Return the node in the content repository which contains all of the routes.

Private Methods

Method Description
documentToStructure ( DocumentInterface $document ) : StructureBridge Return a structure bridge corresponding to the given document.
documentsToStructureCollection ( object[] $documents, array | null $filterOptions = null ) Return a collection of structures for the given documents, optionally filtering according to the given options (as defined in optionsShouldExcludeDocument).
getContentDocument ( $webspaceKey, $locale, array $options = [] ) : Document Return the content document (aka the home page).
getExtensionData ( PHPCR\NodeInterface $node, Sulu\Component\Content\Extension\ExtensionInterface $extension, $propertyName, $webspaceKey, $locale ) Returns data for extension and property name.
getFieldData ( $field, Row $row, PHPCR\NodeInterface $node, $document, $templateKey, $webspaceKey, $locale ) Return data for one field.
getFieldsData ( Row $row, PHPCR\NodeInterface $node, $document, $fields, $templateKey, $webspaceKey, $locale ) Return extracted data (configured by fields array) from node.
getPropertyData ( $document, Property $property ) Returns data for property.
initializeExtensionCache ( ) Initializes cache of extension data.
loadDocument ( $pathOrUuid, $locale, $options, $shouldExclude = true )
loadExtensionData ( PHPCR\NodeInterface $node, Sulu\Component\Content\Extension\ExtensionInterface $extension, $webspaceKey, $locale ) load data from extension.
optionsShouldExcludeDocument ( $document, array $options = null )
rowToArray ( Row $row, $locale, $webspaceKey, $fields, $onlyPublished = true ) converts a query row to an array.

Method Details

__construct() public method

public __construct ( Sulu\Component\DocumentManager\DocumentManager $documentManager, Sulu\Component\Webspace\Manager\WebspaceManagerInterface $webspaceManager, Symfony\Component\Form\FormFactoryInterface $formFactory, DocumentInspector $inspector, PropertyEncoder $encoder, Sulu\Component\Content\Compat\StructureManagerInterface $structureManager, Sulu\Component\Content\Extension\ExtensionManagerInterface $extensionManager, Sulu\Component\Content\ContentTypeManagerInterface $contentTypeManager, Sulu\Component\PHPCR\SessionManager\SessionManagerInterface $sessionManager, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, Sulu\Component\Content\Types\ResourceLocator\Strategy\ResourceLocatorStrategyPoolInterface $resourceLocatorStrategyPool, Sulu\Component\DocumentManager\NamespaceRegistry $namespaceRegistry )
$documentManager Sulu\Component\DocumentManager\DocumentManager
$webspaceManager Sulu\Component\Webspace\Manager\WebspaceManagerInterface
$formFactory Symfony\Component\Form\FormFactoryInterface
$inspector Sulu\Bundle\DocumentManagerBundle\Bridge\DocumentInspector
$encoder Sulu\Bundle\DocumentManagerBundle\Bridge\PropertyEncoder
$structureManager Sulu\Component\Content\Compat\StructureManagerInterface
$extensionManager Sulu\Component\Content\Extension\ExtensionManagerInterface
$contentTypeManager Sulu\Component\Content\ContentTypeManagerInterface
$sessionManager Sulu\Component\PHPCR\SessionManager\SessionManagerInterface
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$resourceLocatorStrategyPool Sulu\Component\Content\Types\ResourceLocator\Strategy\ResourceLocatorStrategyPoolInterface
$namespaceRegistry Sulu\Component\DocumentManager\NamespaceRegistry

convertQueryResultToArray() public method

public convertQueryResultToArray ( PHPCR\Query\QueryResultInterface $queryResult, $webspaceKey, $locales, $fields, $maxDepth, $onlyPublished = true )
$queryResult PHPCR\Query\QueryResultInterface

copyLanguage() public method

public copyLanguage ( $uuid, $userId, $webspaceKey, $srcLocale, $destLocales, $structureType = LegacyStructure::TYPE_PAGE )

delete() public method

public delete ( $uuid, $webspaceKey )

getResourceLocator() public method

Return the resource locator content type.
public getResourceLocator ( ) : Sulu\Component\Content\Types\ResourceLocatorInterface
return Sulu\Component\Content\Types\ResourceLocatorInterface

getRootRouteNode() protected method

Return the node in the content repository which contains all of the routes.
protected getRootRouteNode ( $webspaceKey, string $locale, string $segment ) : PHPCR\NodeInterface
$webspaceKey
$locale string
$segment string
return PHPCR\NodeInterface

load() public method

public load ( $uuid, $webspaceKey, $locale, $loadGhostContent = false )

loadBreadcrumb() public method

public loadBreadcrumb ( $uuid, $locale, $webspaceKey )

loadByNode() public method

public loadByNode ( PHPCR\NodeInterface $node, $locale, $webspaceKey = null, $excludeGhost = true, $loadGhostContent = false, $excludeShadow = true )
$node PHPCR\NodeInterface

loadByParent() public method

public loadByParent ( $uuid, $webspaceKey, $languageCode, $depth = 1, $flat = true, $ignoreExceptions = false, $excludeGhosts = false )

loadByQuery() public method

public loadByQuery ( PHPCR\Query\QueryInterface $query, $locale, $webspaceKey = null, $excludeGhost = true, $loadGhostContent = false )
$query PHPCR\Query\QueryInterface

loadBySql2() public method

public loadBySql2 ( $sql2, $locale, $webspaceKey, $limit = null )

loadNodeAndAncestors() public method

public loadNodeAndAncestors ( $uuid, $locale, $webspaceKey = null, $excludeGhost = true, $excludeShadow = true )

loadShallowStructureByNode() public method

Shallow structures do not have content properties / extensions hydrated.
public loadShallowStructureByNode ( PHPCR\NodeInterface $contentNode, string $localization, string $webspaceKey ) : Sulu\Component\Content\Compat\StructureInterface
$contentNode PHPCR\NodeInterface
$localization string
$webspaceKey string
return Sulu\Component\Content\Compat\StructureInterface

loadStartPage() public method

public loadStartPage ( $webspaceKey, $locale )

orderAt() public method

TODO: Move this logic to the DocumentManager {@inheritdoc}
public orderAt ( $uuid, $position, $userId, $webspaceKey, $locale )

orderBefore() public method

public orderBefore ( $uuid, $beforeUuid, $userId, $webspaceKey, $locale )

saveExtension() public method

. this should be handled in a listener or in the form, or something {@inheritdoc}
public saveExtension ( $uuid, $data, $extensionName, $webspaceKey, $locale, $userId )