Neos\Flow\Property\PropertyMappingConfiguration::skipUnknownProperties PHP Méthode

skipUnknownProperties() public méthode

When this is enabled, properties that are disallowed will be skipped instead of triggering an error during mapping.
public skipUnknownProperties ( ) : PropertyMappingConfiguration
Résultat PropertyMappingConfiguration this
    public function skipUnknownProperties()
    {
        $this->skipUnknownProperties = true;
        return $this;
    }

Usage Example

 /**
  * @test
  */
 public function unknownNodePropertiesAreSkippedIfTypeConverterIsConfiguredLikeThis()
 {
     $this->setupNodeWithShadowNodeInPersonalWorkspace();
     $input = array('__contextNodePath' => '/headline@' . $this->currentTestWorkspaceName, 'title' => 'New title', 'non-existing-input' => 'test');
     $propertyMappingConfiguration = new PropertyMappingConfiguration();
     $propertyMappingConfiguration->skipUnknownProperties();
     $headlineNode = $this->convert($input, $propertyMappingConfiguration);
     $this->assertSame('New title', $headlineNode->getProperty('title'));
     $this->assertSame('Brave new world', $headlineNode->getProperty('subtitle'));
     $this->assertFalse($headlineNode->hasProperty('non-existing-input'));
 }