PHP Class Sulu\Component\Util\SuluNodeHelper

Note this should be removed when we have domain objects.
Afficher le fichier Open project: sulu/sulu Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( PHPCR\SessionInterface $session, string $languageNamespace, array $paths )
extractSnippetTypeFromPath ( string $path ) : string Extract the snippet path from the given path.
extractWebspaceFromPath ( string $path ) : string Extracts webspace key from given path.
getLanguagesForNode ( PHPCR\NodeInterface $node ) : array Return the languages that are currently registered on the given PHPCR node.
getLocalizedPropertyValues ( PHPCR\NodeInterface $node, string $name ) Return all the localized values of the localized property indicated by $name.
getNextNode ( PHPCR\NodeInterface $node ) Return the next node of the given node.
getPreviousNode ( PHPCR\NodeInterface $node ) Return the previous node of the given node.
getStructureTypeForNode ( PHPCR\NodeInterface $node ) : string Return the structure type for the given node.
getTranslatedProperty ( Sulu\Component\Content\Compat\PropertyInterface $property, string $locale, string $prefix = null ) : Sulu\Component\Content\Compat\PropertyInterface Return translated property.
getTranslatedPropertyName ( string $propertyName, string $locale ) : string Return translated property name.
hasSuluNodeType ( PHPCR\NodeInterface $node, string | array $suluNodeTypes ) : boolean Return true if the given node has the given nodeType property (or properties).

Private Methods

Méthode Description
getPath ( string $name ) : string Return the configured named path segment.
getSiblingNode ( PHPCR\NodeInterface $node, boolean $previous = false ) : PHPCR\NodeInterface | null Return either the next or previous sibling of the given node according to the $previous flag.

Method Details

__construct() public méthode

public __construct ( PHPCR\SessionInterface $session, string $languageNamespace, array $paths )
$session PHPCR\SessionInterface
$languageNamespace string
$paths array Path segments from configuration

extractSnippetTypeFromPath() public méthode

Extract the snippet path from the given path.
public extractSnippetTypeFromPath ( string $path ) : string
$path string
Résultat string

extractWebspaceFromPath() public méthode

TODO: We should inject the base path here
public extractWebspaceFromPath ( string $path ) : string
$path string path of node
Résultat string

getLanguagesForNode() public méthode

Return the languages that are currently registered on the given PHPCR node.
public getLanguagesForNode ( PHPCR\NodeInterface $node ) : array
$node PHPCR\NodeInterface
Résultat array

getLocalizedPropertyValues() public méthode

Return all the localized values of the localized property indicated by $name.
public getLocalizedPropertyValues ( PHPCR\NodeInterface $node, string $name )
$node PHPCR\NodeInterface
$name string Name of localized property

getNextNode() public méthode

Return the next node of the given node.
See also: getSiblingNode
public getNextNode ( PHPCR\NodeInterface $node )
$node PHPCR\NodeInterface

getPreviousNode() public méthode

Return the previous node of the given node.
See also: getSiblingNode
public getPreviousNode ( PHPCR\NodeInterface $node )
$node PHPCR\NodeInterface

getStructureTypeForNode() public méthode

Return the structure type for the given node.
public getStructureTypeForNode ( PHPCR\NodeInterface $node ) : string
$node PHPCR\NodeInterface
Résultat string

getTranslatedProperty() public méthode

Return translated property.
public getTranslatedProperty ( Sulu\Component\Content\Compat\PropertyInterface $property, string $locale, string $prefix = null ) : Sulu\Component\Content\Compat\PropertyInterface
$property Sulu\Component\Content\Compat\PropertyInterface
$locale string
$prefix string
Résultat Sulu\Component\Content\Compat\PropertyInterface

getTranslatedPropertyName() public méthode

Return translated property name.
public getTranslatedPropertyName ( string $propertyName, string $locale ) : string
$propertyName string
$locale string
Résultat string

hasSuluNodeType() public méthode

The sulu node type is the local name of node types with the sulu namespace. Example: sulu:snippet is the PHPCR node type snippet is the Sulu node type
public hasSuluNodeType ( PHPCR\NodeInterface $node, string | array $suluNodeTypes ) : boolean
$node PHPCR\NodeInterface
$suluNodeTypes string | array One or more node sulu types
Résultat boolean