PHP Класс Neos\ContentRepository\Domain\Service\ImportExport\NodeImportService

Internally, uses associative arrays instead of Domain Models for performance reasons, so "nodeData" in this class is always an associative array.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$entityManager Doctrine\Common\Persistence\ObjectManager ..
$nodeDataPropertyNames array For each element, an array of additional settings can be specified; currently the only setting is the following: - columnType => \PDO::PARAM_*
$nodeDataStack array
$nodeIdentifierStack array
$nodeNameStack array
$persistenceManager Neos\Flow\Persistence\PersistenceManagerInterface
$propertyMapper Neos\Flow\Property\PropertyMapper
$propertyMappingConfiguration ImportExportPropertyMappingConfiguration
$securityContext Neos\Flow\Security\Context

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

Метод Описание
import ( XMLReader $xmlReader, string $targetPath, string $resourceLoadPath = null ) : void Imports the sub-tree from the xml reader into the given target path.

Защищенные методы

Метод Описание
convertElementToValue ( XMLReader $reader, string $currentType, string $currentEncoding, string $currentClassName, string $currentNodeIdentifier, string $currentProperty ) : mixed Convert an element to the value it represents.
determineFormatVersion ( XMLReader $xmlReader ) : null | string Determines the ContentRepository format version of the given xml
getCurrentPath ( ) : string Provides the path for a NodeData according to the current stacks
getParentPath ( string $path ) : string Provides the parent of the given path
importSubtree ( XMLReader $xmlReader ) : void Imports the sub-tree from the xml reader into the given target path.
parseArrayElements ( XMLReader $reader, string $elementName, string $currentNodeIdentifier ) : array Parses the content of exported array and returns the values
parseDimensionsElement ( XMLReader $reader ) : array Parses the content of the dimensions-tag and returns the dimensions as an array 'dimension name' => dimension value
parseElement ( XMLReader $xmlReader ) : void Parses the given XML element and adds its content to the internal content tree
parseEndElement ( XMLReader $reader ) : void Parses the closing tags writes data to the database then
parsePropertiesElement ( XMLReader $reader, string $currentNodeIdentifier ) : array Parses the content of the properties-tag and returns the properties as an array 'property name' => property value
persistEntities ( mixed $propertyValue ) : void Checks if a propertyValue contains an entity and persists it.
persistNodeData ( array $nodeData ) : void Saves the given array as a node data entity without using the ORM.

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

convertElementToValue() защищенный Метод

Convert an element to the value it represents.
protected convertElementToValue ( XMLReader $reader, string $currentType, string $currentEncoding, string $currentClassName, string $currentNodeIdentifier, string $currentProperty ) : mixed
$reader XMLReader
$currentType string current element (userland) type
$currentEncoding string date encoding of element
$currentClassName string class name of element
$currentNodeIdentifier string identifier of the node
$currentProperty string current property name
Результат mixed

determineFormatVersion() защищенный Метод

Determines the ContentRepository format version of the given xml
protected determineFormatVersion ( XMLReader $xmlReader ) : null | string
$xmlReader XMLReader
Результат null | string the version as a string or null if the version could not be determined

getCurrentPath() защищенный Метод

Provides the path for a NodeData according to the current stacks
protected getCurrentPath ( ) : string
Результат string

getParentPath() защищенный Метод

Provides the parent of the given path
protected getParentPath ( string $path ) : string
$path string path to get parent for
Результат string parent path

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

The root node of the imported tree becomes a child of the node specified as the target path, as the following example illustrates: 1. Existing Nodes Before Import: path - to - - my - - - targetNode - - - - A - other - - nodes 2. Sub-tree in xml to import to 'path/to/my/targetNode': - 3. existing nodes after the import: path - to - - my - - - targetNode - - - - A - - - - B - - - - - B1 - another - - sub-tree
public import ( XMLReader $xmlReader, string $targetPath, string $resourceLoadPath = null ) : void
$xmlReader XMLReader The XML input to import - must be either XML as a string or a prepared \XMLReader instance containing XML data
$targetPath string path to the node which becomes parent of the root of the imported sub-tree
$resourceLoadPath string
Результат void

importSubtree() защищенный Метод

The root node of the imported tree becomes a child of the node specified by target path. This parser uses the depth-first reading strategy, which means it will read the input from top til bottom.
protected importSubtree ( XMLReader $xmlReader ) : void
$xmlReader XMLReader A prepared XML Reader with the structure to import
Результат void

parseArrayElements() защищенный Метод

Parses the content of exported array and returns the values
protected parseArrayElements ( XMLReader $reader, string $elementName, string $currentNodeIdentifier ) : array
$reader XMLReader reader positioned just after an opening array-tag
$elementName string
$currentNodeIdentifier string
Результат array the array values

parseDimensionsElement() защищенный Метод

Parses the content of the dimensions-tag and returns the dimensions as an array 'dimension name' => dimension value
protected parseDimensionsElement ( XMLReader $reader ) : array
$reader XMLReader reader positioned just after an opening dimensions-tag
Результат array the dimension values

parseElement() защищенный Метод

Parses the given XML element and adds its content to the internal content tree
protected parseElement ( XMLReader $xmlReader ) : void
$xmlReader XMLReader The XML Reader with the element to be parsed as its root
Результат void

parseEndElement() защищенный Метод

Parses the closing tags writes data to the database then
protected parseEndElement ( XMLReader $reader ) : void
$reader XMLReader
Результат void

parsePropertiesElement() защищенный Метод

Parses the content of the properties-tag and returns the properties as an array 'property name' => property value
protected parsePropertiesElement ( XMLReader $reader, string $currentNodeIdentifier ) : array
$reader XMLReader reader positioned just after an opening properties-tag
$currentNodeIdentifier string
Результат array the properties

persistEntities() защищенный Метод

Checks if a propertyValue contains an entity and persists it.
protected persistEntities ( mixed $propertyValue ) : void
$propertyValue mixed
Результат void

persistNodeData() защищенный Метод

If the node data already exists (same dimensions, same identifier, same workspace) it is replaced.
protected persistNodeData ( array $nodeData ) : void
$nodeData array node data to save as an associative array ( $column_name => $value )
Результат void

Описание свойств

$entityManager защищенное свойство

..
protected ObjectManager,Doctrine\Common\Persistence $entityManager
Результат Doctrine\Common\Persistence\ObjectManager

$nodeDataPropertyNames защищенное свойство

For each element, an array of additional settings can be specified; currently the only setting is the following: - columnType => \PDO::PARAM_*
protected array $nodeDataPropertyNames
Результат array

$nodeDataStack защищенное свойство

protected array $nodeDataStack
Результат array

$nodeIdentifierStack защищенное свойство

protected array $nodeIdentifierStack
Результат array

$nodeNameStack защищенное свойство

protected array $nodeNameStack
Результат array

$persistenceManager защищенное свойство

protected PersistenceManagerInterface,Neos\Flow\Persistence $persistenceManager
Результат Neos\Flow\Persistence\PersistenceManagerInterface

$propertyMapper защищенное свойство

protected PropertyMapper,Neos\Flow\Property $propertyMapper
Результат Neos\Flow\Property\PropertyMapper

$propertyMappingConfiguration защищенное свойство

protected ImportExportPropertyMappingConfiguration,Neos\ContentRepository\Domain\Service\ImportExport $propertyMappingConfiguration
Результат ImportExportPropertyMappingConfiguration

$securityContext защищенное свойство

protected Context,Neos\Flow\Security $securityContext
Результат Neos\Flow\Security\Context