PHP Class Sulu\Bundle\ContentBundle\Repository\NodeRepository

Inheritance: implements Sulu\Bundle\ContentBundle\Repository\NodeRepositoryInterface
Exibir arquivo Open project: sulu/sulu

Public Methods

Method Description
__construct ( Sulu\Component\Content\Mapper\ContentMapperInterface $mapper, Sulu\Component\PHPCR\SessionManager\SessionManagerInterface $sessionManager, Sulu\Bundle\AdminBundle\UserManager\UserManagerInterface $userManager, Sulu\Component\Webspace\Manager\WebspaceManagerInterface $webspaceManager, Sulu\Component\Content\Query\ContentQueryBuilderInterface $queryBuilder, Sulu\Component\Content\Query\ContentQueryExecutorInterface $queryExecutor, Sulu\Component\Security\Authorization\AccessControl\AccessControlManagerInterface $accessControlManager, Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface $tokenStorage = null, Psr\Log\LoggerInterface $logger )
copyLocale ( $uuid, $userId, $webspaceKey, $srcLocale, $destLocales )
deleteNode ( $uuid, $webspaceKey )
getFilteredNodes ( array $filterConfig, $languageCode, $webspaceKey, $preview = false, $api = false, $exclude = [] )
getIndexNode ( $webspaceKey, $languageCode )
getNode ( $uuid, $webspaceKey, $languageCode, $breadcrumb = false, $complete = true, $loadGhostContent = false )
getNodes ( $parent, $webspaceKey, $languageCode, $depth = 1, $flat = true, $complete = true, $excludeGhosts = false )
getNodesByIds ( $ids, $webspaceKey, $languageCode )
getNodesTree ( $uuid, $webspaceKey, $languageCode, $excludeGhosts = false, $excludeShadows = false, $appendWebspaceNode = false )
getReferences ( $uuid )
getWebspaceNode ( $webspaceKey, $languageCode, $depth = 1, $excludeGhosts = false )
getWebspaceNodes ( $languageCode )
loadExtensionData ( $uuid, $extensionName, $webspaceKey, $languageCode )
orderAt ( $uuid, $position, $webspaceKey, $languageCode, $userId )
saveExtensionData ( $uuid, $data, $extensionName, $webspaceKey, $languageCode, $userId )
setApiBasePath ( string $apiBasePath )

Protected Methods

Method Description
getFullNameByUserId ( integer $id ) : string returns user fullName.
getMapper ( ) : Sulu\Component\Content\Mapper\ContentMapperInterface return content mapper.
prepareNode ( Sulu\Component\Content\Compat\StructureInterface $structure, string $webspaceKey, string $languageCode, integer $depth = 1, boolean $complete = true, boolean $excludeGhosts = false, string | null $extension = null ) : array returns finished Node (with _links and _embedded).

Private Methods

Method Description
createWebspaceNode ( $webspaceKey, $languageCode, $depth = 1, $excludeGhosts = false ) Creates a webspace node.
getParentNode ( string | null $parent, string $webspaceKey, string $languageCode ) : Sulu\Component\Content\Compat\StructureInterface if parent is null return home page else the page with given uuid.
iterateTiers ( array $tiers, array &$result ) Iterate over the ancestor tiers and build up the result.
loadNodeAndAncestors ( string $uuid, string $webspaceKey, string $locale, boolean $excludeGhosts, boolean $excludeShadows, boolean $complete ) : array Load the node and its ancestors and convert them into a HATEOAS representation.
prepareNodesTree ( Sulu\Component\Content\Compat\StructureInterface[] $nodes, string $webspaceKey, string $languageCode, boolean $complete = true, boolean $excludeGhosts = false, $maxDepth = 1, $currentDepth ) : array

Method Details

__construct() public method

public __construct ( Sulu\Component\Content\Mapper\ContentMapperInterface $mapper, Sulu\Component\PHPCR\SessionManager\SessionManagerInterface $sessionManager, Sulu\Bundle\AdminBundle\UserManager\UserManagerInterface $userManager, Sulu\Component\Webspace\Manager\WebspaceManagerInterface $webspaceManager, Sulu\Component\Content\Query\ContentQueryBuilderInterface $queryBuilder, Sulu\Component\Content\Query\ContentQueryExecutorInterface $queryExecutor, Sulu\Component\Security\Authorization\AccessControl\AccessControlManagerInterface $accessControlManager, Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface $tokenStorage = null, Psr\Log\LoggerInterface $logger )
$mapper Sulu\Component\Content\Mapper\ContentMapperInterface
$sessionManager Sulu\Component\PHPCR\SessionManager\SessionManagerInterface
$userManager Sulu\Bundle\AdminBundle\UserManager\UserManagerInterface
$webspaceManager Sulu\Component\Webspace\Manager\WebspaceManagerInterface
$queryBuilder Sulu\Component\Content\Query\ContentQueryBuilderInterface
$queryExecutor Sulu\Component\Content\Query\ContentQueryExecutorInterface
$accessControlManager Sulu\Component\Security\Authorization\AccessControl\AccessControlManagerInterface
$tokenStorage Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface
$logger Psr\Log\LoggerInterface

copyLocale() public method

public copyLocale ( $uuid, $userId, $webspaceKey, $srcLocale, $destLocales )

deleteNode() public method

public deleteNode ( $uuid, $webspaceKey )

getFilteredNodes() public method

public getFilteredNodes ( array $filterConfig, $languageCode, $webspaceKey, $preview = false, $api = false, $exclude = [] )
$filterConfig array

getFullNameByUserId() protected method

returns user fullName.
protected getFullNameByUserId ( integer $id ) : string
$id integer userId
return string

getIndexNode() public method

public getIndexNode ( $webspaceKey, $languageCode )

getMapper() protected method

return content mapper.
protected getMapper ( ) : Sulu\Component\Content\Mapper\ContentMapperInterface
return Sulu\Component\Content\Mapper\ContentMapperInterface

getNode() public method

public getNode ( $uuid, $webspaceKey, $languageCode, $breadcrumb = false, $complete = true, $loadGhostContent = false )

getNodes() public method

public getNodes ( $parent, $webspaceKey, $languageCode, $depth = 1, $flat = true, $complete = true, $excludeGhosts = false )

getNodesByIds() public method

public getNodesByIds ( $ids, $webspaceKey, $languageCode )

getNodesTree() public method

public getNodesTree ( $uuid, $webspaceKey, $languageCode, $excludeGhosts = false, $excludeShadows = false, $appendWebspaceNode = false )

getReferences() public method

public getReferences ( $uuid )

getWebspaceNode() public method

public getWebspaceNode ( $webspaceKey, $languageCode, $depth = 1, $excludeGhosts = false )

getWebspaceNodes() public method

public getWebspaceNodes ( $languageCode )

loadExtensionData() public method

public loadExtensionData ( $uuid, $extensionName, $webspaceKey, $languageCode )

orderAt() public method

public orderAt ( $uuid, $position, $webspaceKey, $languageCode, $userId )

prepareNode() protected method

returns finished Node (with _links and _embedded).
Deprecation: This part should be split into a serialization handler and using the hateoas bundle
protected prepareNode ( Sulu\Component\Content\Compat\StructureInterface $structure, string $webspaceKey, string $languageCode, integer $depth = 1, boolean $complete = true, boolean $excludeGhosts = false, string | null $extension = null ) : array
$structure Sulu\Component\Content\Compat\StructureInterface
$webspaceKey string
$languageCode string
$depth integer
$complete boolean
$excludeGhosts boolean
$extension string | null
return array

saveExtensionData() public method

public saveExtensionData ( $uuid, $data, $extensionName, $webspaceKey, $languageCode, $userId )

setApiBasePath() public method

public setApiBasePath ( string $apiBasePath )
$apiBasePath string