PHP Класс Sulu\Component\Util\SuluNodeHelper

Note this should be removed when we have domain objects.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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).

Приватные методы

Метод Описание
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.

Описание методов

__construct() публичный Метод

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

extractSnippetTypeFromPath() публичный Метод

Extract the snippet path from the given path.
public extractSnippetTypeFromPath ( string $path ) : string
$path string
Результат string

extractWebspaceFromPath() публичный Метод

TODO: We should inject the base path here
public extractWebspaceFromPath ( string $path ) : string
$path string path of node
Результат string

getLanguagesForNode() публичный Метод

Return the languages that are currently registered on the given PHPCR node.
public getLanguagesForNode ( PHPCR\NodeInterface $node ) : array
$node PHPCR\NodeInterface
Результат array

getLocalizedPropertyValues() публичный Метод

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() публичный Метод

Return the next node of the given node.
См. также: getSiblingNode
public getNextNode ( PHPCR\NodeInterface $node )
$node PHPCR\NodeInterface

getPreviousNode() публичный Метод

Return the previous node of the given node.
См. также: getSiblingNode
public getPreviousNode ( PHPCR\NodeInterface $node )
$node PHPCR\NodeInterface

getStructureTypeForNode() публичный Метод

Return the structure type for the given node.
public getStructureTypeForNode ( PHPCR\NodeInterface $node ) : string
$node PHPCR\NodeInterface
Результат string

getTranslatedProperty() публичный Метод

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
Результат Sulu\Component\Content\Compat\PropertyInterface

getTranslatedPropertyName() публичный Метод

Return translated property name.
public getTranslatedPropertyName ( string $propertyName, string $locale ) : string
$propertyName string
$locale string
Результат string

hasSuluNodeType() публичный Метод

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
Результат boolean