Neos.ContentRepository/Classes/Domain/Service/ImportExport/NodeImportService.php
protected function persistEntities($propertyValue)
    {
        if (!$propertyValue instanceof \Iterator && !is_array($propertyValue)) {
            $propertyValue = [$propertyValue];
        }
        foreach ($propertyValue as $possibleEntity) {
            if (is_object($possibleEntity) && $possibleEntity instanceof PersistenceMagicInterface) {
                $this->persistenceManager->isNewObject($possibleEntity) ? $this->persistenceManager->add($possibleEntity) : $this->persistenceManager->update($possibleEntity);

                // TODO: Needed because the originalAsset will not cascade persist. We should find a generic solution to this.
                if ($possibleEntity instanceof ImageVariant) {
                    $asset = $possibleEntity->getOriginalAsset();
                    $this->persistenceManager->isNewObject($asset) ? $this->persistenceManager->add($asset) : $this->persistenceManager->update($asset);
                }
            }
        }
    }
protected function persistEntities($propertyValue)
    {
        if (!$propertyValue instanceof \Iterator && !is_array($propertyValue)) {
            $propertyValue = [$propertyValue];
        }
        foreach ($propertyValue as $possibleEntity) {
            if (is_object($possibleEntity) && $possibleEntity instanceof PersistenceMagicInterface) {
                $this->persistenceManager->isNewObject($possibleEntity) ? $this->persistenceManager->add($possibleEntity) : $this->persistenceManager->update($possibleEntity);

                // TODO: Needed because the originalAsset will not cascade persist. We should find a generic solution to this.
                if ($possibleEntity instanceof ImageVariant) {
                    $asset = $possibleEntity->getOriginalAsset();
                    $this->persistenceManager->isNewObject($asset) ? $this->persistenceManager->add($asset) : $this->persistenceManager->update($asset);
                }
            }
        }
    }
protected function persistEntities ( $ propertyValue ) { if ( ! $ propertyValue instanceof \ Iterator && ! is_array ( $ propertyValue ) ) { $ propertyValue = [ $ propertyValue ] ; } foreach ( $ propertyValue as $ possibleEntity ) { if ( is_object ( $ possibleEntity ) && $ possibleEntity instanceof PersistenceMagicInterface ) { $ this -> persistenceManager -> isNewObject ( $ possibleEntity ) ? $ this -> persistenceManager -> add ( $ possibleEntity ) : $ this -> persistenceManager -> update ( $ possibleEntity ) ; // TODO: Needed because the originalAsset will not cascade persist. We should find a generic solution to this. if ( $ possibleEntity instanceof ImageVariant ) { $ asset = $ possibleEntity -> getOriginalAsset ( ) ; $ this -> persistenceManager -> isNewObject ( $ asset ) ? $ this -> persistenceManager -> add ( $ asset ) : $ this -> persistenceManager -> update ( $ asset ) ; } } } }
Checks if a propertyValue contains an entity and persists it.

@param mixed $propertyValue
@return void
Checks if a propertyValue contains an entity and persists it .