PHP Class Sulu\Component\Content\Repository\ContentRepository

Inheritance: implements Sulu\Component\Content\Repository\ContentRepositoryInterface
Show file Open project: sulu/sulu Class Usage Examples

Public Methods

Method Description
__construct ( Sulu\Component\PHPCR\SessionManager\SessionManagerInterface $sessionManager, Sulu\Component\DocumentManager\PropertyEncoder $propertyEncoder, Sulu\Component\Webspace\Manager\WebspaceManagerInterface $webspaceManager, Sulu\Component\Content\Compat\LocalizationFinderInterface $localizationFinder, Sulu\Component\Content\Compat\StructureManagerInterface $structureManager, SuluNodeHelper $nodeHelper )
find ( $uuid, $locale, $webspaceKey, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, Sulu\Component\Security\Authentication\UserInterface $user = null )
findAll ( $locale, $webspaceKey, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, Sulu\Component\Security\Authentication\UserInterface $user = null )
findAllByPortal ( $locale, $portalKey, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, Sulu\Component\Security\Authentication\UserInterface $user = null )
findByParentUuid ( $uuid, $locale, $webspaceKey, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, Sulu\Component\Security\Authentication\UserInterface $user = null )
findByPaths ( array $paths, $locale, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, Sulu\Component\Security\Authentication\UserInterface $user = null )
findByUuids ( array $uuids, $locale, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, Sulu\Component\Security\Authentication\UserInterface $user = null )
findByWebspaceRoot ( $locale, $webspaceKey, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, Sulu\Component\Security\Authentication\UserInterface $user = null )
findParentsWithSiblingsByUuid ( $uuid, $locale, $webspaceKey, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, Sulu\Component\Security\Authentication\UserInterface $user = null )
resolveInternalLinkContent ( Row $row, string $locale, string $webspaceKey, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, StructureType $type = null, Sulu\Component\Security\Authentication\UserInterface $user = null ) : Content Resolve a single result row which is an internal link to a content object.

Private Methods

Method Description
appendMapping ( PHPCR\Util\QOM\QueryBuilder $queryBuilder, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, string $locale, string[] $locales ) Append mapping selects to given query-builder.
appendSingleMapping ( PHPCR\Util\QOM\QueryBuilder $queryBuilder, string $propertyName, string[] $locales ) Append mapping selects for a single property to given query-builder.
appendUrlMapping ( PHPCR\Util\QOM\QueryBuilder $queryBuilder, string[] $locales ) Append mapping for url to given query-builder.
generateTreeByPath ( array $contents ) : Content[] Generates a content-tree with paths of given content array.
getLocales ( ) : string[] Returns array of locales for webspaces.
getLocalesByPortalKey ( string $portalKey ) : string[] Returns array of locales for given portal key.
getLocalesByWebspaceKey ( string $webspaceKey ) : string[] Returns array of locales for given webspace key.
getQueryBuilder ( string $locale, string[] $locales, Sulu\Component\Security\Authentication\UserInterface $user = null ) : PHPCR\Util\QOM\QueryBuilder Returns QueryBuilder with basic select and where statements.
resolveAvailableLocales ( Row $row ) : string[] Resolves all available localizations for given row.
resolveContent ( Row $row, string $locale, string $locales, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, Sulu\Component\Security\Authentication\UserInterface $user = null ) : Content Resolve a single result row to a content object.
resolveHasChildren ( Row $row ) : boolean Resolve property has-children with given node.
resolvePath ( Row $row, string $webspaceKey ) : string Resolves path for given row.
resolvePathByUuid ( string $uuid ) : string Resolve path for node with given uuid.
resolvePermissions ( Row $row, Sulu\Component\Security\Authentication\UserInterface $user = null ) : array Resolves permissions for given user.
resolveProperty ( Row $row, string $name, string $locale, string $shadowLocale = null ) : mixed Resolve a property and follow shadow locale if it has one.
resolveQueryBuilder ( PHPCR\Util\QOM\QueryBuilder $queryBuilder, string $locale, $locales, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, Sulu\Component\Security\Authentication\UserInterface $user = null ) : Content[] Resolves query results to content.
resolveUrl ( Row $row, string $locale ) : string Resolve url property.

Method Details

__construct() public method

public __construct ( Sulu\Component\PHPCR\SessionManager\SessionManagerInterface $sessionManager, Sulu\Component\DocumentManager\PropertyEncoder $propertyEncoder, Sulu\Component\Webspace\Manager\WebspaceManagerInterface $webspaceManager, Sulu\Component\Content\Compat\LocalizationFinderInterface $localizationFinder, Sulu\Component\Content\Compat\StructureManagerInterface $structureManager, SuluNodeHelper $nodeHelper )
$sessionManager Sulu\Component\PHPCR\SessionManager\SessionManagerInterface
$propertyEncoder Sulu\Component\DocumentManager\PropertyEncoder
$webspaceManager Sulu\Component\Webspace\Manager\WebspaceManagerInterface
$localizationFinder Sulu\Component\Content\Compat\LocalizationFinderInterface
$structureManager Sulu\Component\Content\Compat\StructureManagerInterface
$nodeHelper Sulu\Component\Util\SuluNodeHelper

find() public method

public find ( $uuid, $locale, $webspaceKey, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, Sulu\Component\Security\Authentication\UserInterface $user = null )
$mapping Sulu\Component\Content\Repository\Mapping\MappingInterface
$user Sulu\Component\Security\Authentication\UserInterface

findAll() public method

public findAll ( $locale, $webspaceKey, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, Sulu\Component\Security\Authentication\UserInterface $user = null )
$mapping Sulu\Component\Content\Repository\Mapping\MappingInterface
$user Sulu\Component\Security\Authentication\UserInterface

findAllByPortal() public method

public findAllByPortal ( $locale, $portalKey, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, Sulu\Component\Security\Authentication\UserInterface $user = null )
$mapping Sulu\Component\Content\Repository\Mapping\MappingInterface
$user Sulu\Component\Security\Authentication\UserInterface

findByParentUuid() public method

public findByParentUuid ( $uuid, $locale, $webspaceKey, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, Sulu\Component\Security\Authentication\UserInterface $user = null )
$mapping Sulu\Component\Content\Repository\Mapping\MappingInterface
$user Sulu\Component\Security\Authentication\UserInterface

findByPaths() public method

public findByPaths ( array $paths, $locale, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, Sulu\Component\Security\Authentication\UserInterface $user = null )
$paths array
$mapping Sulu\Component\Content\Repository\Mapping\MappingInterface
$user Sulu\Component\Security\Authentication\UserInterface

findByUuids() public method

public findByUuids ( array $uuids, $locale, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, Sulu\Component\Security\Authentication\UserInterface $user = null )
$uuids array
$mapping Sulu\Component\Content\Repository\Mapping\MappingInterface
$user Sulu\Component\Security\Authentication\UserInterface

findByWebspaceRoot() public method

public findByWebspaceRoot ( $locale, $webspaceKey, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, Sulu\Component\Security\Authentication\UserInterface $user = null )
$mapping Sulu\Component\Content\Repository\Mapping\MappingInterface
$user Sulu\Component\Security\Authentication\UserInterface

findParentsWithSiblingsByUuid() public method

public findParentsWithSiblingsByUuid ( $uuid, $locale, $webspaceKey, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, Sulu\Component\Security\Authentication\UserInterface $user = null )
$mapping Sulu\Component\Content\Repository\Mapping\MappingInterface
$user Sulu\Component\Security\Authentication\UserInterface

resolveInternalLinkContent() public method

Resolve a single result row which is an internal link to a content object.
public resolveInternalLinkContent ( Row $row, string $locale, string $webspaceKey, Sulu\Component\Content\Repository\Mapping\MappingInterface $mapping, StructureType $type = null, Sulu\Component\Security\Authentication\UserInterface $user = null ) : Content
$row Jackalope\Query\Row
$locale string
$webspaceKey string
$mapping Sulu\Component\Content\Repository\Mapping\MappingInterface Includes array of property names
$type Sulu\Component\Content\Compat\StructureType
$user Sulu\Component\Security\Authentication\UserInterface
return Content