build() public method

Builds the default property mapping configuration.
See also: PropertyMapper::buildPropertyMappingConfiguration
Deprecation: fully replace by PropertyMapper::buildPropertyMappingConfiguration and removed in next major Flow version
public build ( string $type = PropertyMappingConfiguration::class ) : PropertyMappingConfiguration
$type string the implementation class name of the PropertyMappingConfiguration to instantiate; must be a subclass of PropertyMappingConfiguration
return PropertyMappingConfiguration
 /**
  * Publishes or discards the given nodes
  *
  * @param array $nodes <\Neos\ContentRepository\Domain\Model\NodeInterface> $nodes
  * @param string $action
  * @param Workspace $selectedWorkspace
  * @throws \Exception
  * @throws \Neos\Flow\Property\Exception
  * @throws \Neos\Flow\Security\Exception
  */
 public function publishOrDiscardNodesAction(array $nodes, $action, Workspace $selectedWorkspace = null)
 {
     $propertyMappingConfiguration = $this->propertyMappingConfigurationBuilder->build();
     $propertyMappingConfiguration->setTypeConverterOption(NodeConverter::class, NodeConverter::REMOVED_CONTENT_SHOWN, true);
     foreach ($nodes as $key => $node) {
         $nodes[$key] = $this->propertyMapper->convert($node, NodeInterface::class, $propertyMappingConfiguration);
     }
     switch ($action) {
         case 'publish':
             foreach ($nodes as $node) {
                 $this->publishingService->publishNode($node);
             }
             $this->addFlashMessage($this->translator->translateById('workspaces.selectedChangesHaveBeenPublished', [], null, null, 'Modules', 'Neos.Neos'));
             break;
         case 'discard':
             $this->publishingService->discardNodes($nodes);
             $this->addFlashMessage($this->translator->translateById('workspaces.selectedChangesHaveBeenDiscarded', [], null, null, 'Modules', 'Neos.Neos'));
             break;
         default:
             throw new \RuntimeException('Invalid action "' . htmlspecialchars($action) . '" given.', 1346167441);
     }
     $this->redirect('show', null, null, ['workspace' => $selectedWorkspace]);
 }