PHP Class Jarves\PageStack

Afficher le fichier Open project: jarves/jarves Class Usage Examples

Protected Properties

Свойство Type Description
$adminPrefix string
$domain Jarves\Model\Domain | null
$node Jarves\Model\Node | null
$pageResponse PageResponse

Méthodes publiques

Méthode Description
__construct ( string $adminPrefix, Symfony\Component\HttpFoundation\RequestStack $requestStack, Cacher $cacher, Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface $tokenStorage )
getAdminPrefix ( ) : string
getCachedPageToUrl ( integer $domainId ) : array Returns a array map nodeId -> url
getCachedUrlToPage ( integer $domainId ) : array Returns a array map url -> nodeId
getCurrentDomain ( ) : Domain
getCurrentPage ( ) : Node | null
getCurrentUrl ( boolean $full = false ) : string
getCurrentUrlAffix ( ) : string Returns the affix relative to current page.
getDomain ( integer $domainId = null ) : Domain Returns Domain object. This tries to cache the domain, so its a faster access method than using DomainQuery classes.
getDomainOfPage ( integer $id ) : integer | null Returns the domain of the given $id page.
getNodeUrl ( Node | integer | string $nodeOrId, boolean $fullUrl = false, boolean $suppressStartNodeCheck = false ) : string
getPage ( Node | string | integer $node ) : Node | null Returns a super fast cached Page object.
getPageResponse ( ) : PageResponse | null
getRequest ( ) : null | Request Returns always the master request.
getRequestStack ( ) : Symfony\Component\HttpFoundation\RequestStack
getRouteUrl ( Node | integer $nodeOrId, boolean $suppressStartNodeCheck = false ) : string
getSession ( ) : null | Symfony\Component\HttpFoundation\Session\SessionInterface Returns the current session. if available.
getToken ( ) : null | Symfony\Component\Security\Core\Authentication\Token\TokenInterface
getUser ( ) : Symfony\Component\Security\Core\User\UserInterface | null Returns the current logged in User if available. Null if not or another token than Jarves' is active.
isAdmin ( ) : boolean When a route is loading within /jarves
isLoggedIn ( ) : boolean Returns true when a non AnonymousToken is set (which primarily means a real User is logged in)
reset ( )
setCurrentDomain ( Domain $domain )
setCurrentPage ( Node $node )
setPageResponse ( PageResponse $pageResponse )
updatePage2DomainCache ( )

Method Details

__construct() public méthode

public __construct ( string $adminPrefix, Symfony\Component\HttpFoundation\RequestStack $requestStack, Cacher $cacher, Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface $tokenStorage )
$adminPrefix string
$requestStack Symfony\Component\HttpFoundation\RequestStack
$cacher Jarves\Cache\Cacher
$tokenStorage Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface

getAdminPrefix() public méthode

public getAdminPrefix ( ) : string
Résultat string

getCachedPageToUrl() public méthode

Returns a array map nodeId -> url
public getCachedPageToUrl ( integer $domainId ) : array
$domainId integer
Résultat array

getCachedUrlToPage() public méthode

Returns a array map url -> nodeId
public getCachedUrlToPage ( integer $domainId ) : array
$domainId integer
Résultat array

getCurrentDomain() public méthode

public getCurrentDomain ( ) : Domain
Résultat Jarves\Model\Domain

getCurrentPage() public méthode

public getCurrentPage ( ) : Node | null
Résultat Jarves\Model\Node | null

getCurrentUrl() public méthode

public getCurrentUrl ( boolean $full = false ) : string
$full boolean
Résultat string

getCurrentUrlAffix() public méthode

If the current page is : /documentation/field, but the actual loaded route is: /documentation/field/field-name, then '/field-name' is returned. This can be the case, when a plugin added own routes and returned a result for '/field-name'.
public getCurrentUrlAffix ( ) : string
Résultat string

getDomain() public méthode

Returns Domain object. This tries to cache the domain, so its a faster access method than using DomainQuery classes.
public getDomain ( integer $domainId = null ) : Domain
$domainId integer If not defined, it returns the current domain.
Résultat Jarves\Model\Domain

getDomainOfPage() public méthode

Returns the domain of the given $id page.
public getDomainOfPage ( integer $id ) : integer | null
$id integer
Résultat integer | null

getNodeUrl() public méthode

public getNodeUrl ( Node | integer | string $nodeOrId, boolean $fullUrl = false, boolean $suppressStartNodeCheck = false ) : string
$nodeOrId Jarves\Model\Node | integer | string
$fullUrl boolean with http://
$suppressStartNodeCheck boolean
Résultat string

getPage() public méthode

Returns a super fast cached Page object.
public getPage ( Node | string | integer $node ) : Node | null
$node Jarves\Model\Node | string | integer Node model, url or node id
Résultat Jarves\Model\Node | null

getPageResponse() public méthode

public getPageResponse ( ) : PageResponse | null
Résultat PageResponse | null

getRequest() public méthode

Returns always the master request.
public getRequest ( ) : null | Request
Résultat null | Symfony\Component\HttpFoundation\Request

getRequestStack() public méthode

public getRequestStack ( ) : Symfony\Component\HttpFoundation\RequestStack
Résultat Symfony\Component\HttpFoundation\RequestStack

getRouteUrl() public méthode

public getRouteUrl ( Node | integer $nodeOrId, boolean $suppressStartNodeCheck = false ) : string
$nodeOrId Jarves\Model\Node | integer
$suppressStartNodeCheck boolean
Résultat string

getSession() public méthode

Returns the current session. if available.
public getSession ( ) : null | Symfony\Component\HttpFoundation\Session\SessionInterface
Résultat null | Symfony\Component\HttpFoundation\Session\SessionInterface

getToken() public méthode

public getToken ( ) : null | Symfony\Component\Security\Core\Authentication\Token\TokenInterface
Résultat null | Symfony\Component\Security\Core\Authentication\Token\TokenInterface

getUser() public méthode

Returns the current logged in User if available. Null if not or another token than Jarves' is active.
public getUser ( ) : Symfony\Component\Security\Core\User\UserInterface | null
Résultat Symfony\Component\Security\Core\User\UserInterface | null

isAdmin() public méthode

When a route is loading within /jarves
public isAdmin ( ) : boolean
Résultat boolean

isLoggedIn() public méthode

Returns true when a non AnonymousToken is set (which primarily means a real User is logged in)
public isLoggedIn ( ) : boolean
Résultat boolean

reset() public méthode

public reset ( )

setCurrentDomain() public méthode

public setCurrentDomain ( Domain $domain )
$domain Jarves\Model\Domain

setCurrentPage() public méthode

public setCurrentPage ( Node $node )
$node Jarves\Model\Node

setPageResponse() public méthode

public setPageResponse ( PageResponse $pageResponse )
$pageResponse PageResponse

updatePage2DomainCache() public méthode

Property Details

$adminPrefix protected_oe property

protected string $adminPrefix
Résultat string

$domain protected_oe property

protected Domain,Jarves\Model|null $domain
Résultat Jarves\Model\Domain | null

$node protected_oe property

protected Node,Jarves\Model|null $node
Résultat Jarves\Model\Node | null

$pageResponse protected_oe property

protected PageResponse,jarves $pageResponse
Résultat PageResponse