forProperty($propertyPath)->setTypeConverterOption(PersistentObjectConverter::class, PersistentObjectConverter::CONFIGURATION_CREATION_ALLOWED, true); } /** * Allow modification for a given property path * * @param string $propertyPath */ public function allowModificationForSubProperty($propertyPath) { $this->forProperty($propertyPath)->setTypeConverterOption(PersistentObjectConverter::class, PersistentObjectConverter::CONFIGURATION_MODIFICATION_ALLOWED, true); } /** * Set the target type for a certain property. Especially useful * if there is an object which has a nested object which is abstract, * and you want to instantiate a concrete object instead. * * @param string $propertyPath * @param string $targetType */ public function setTargetTypeForSubProperty($propertyPath, $targetType) { $this->forProperty($propertyPath)->setTypeConverterOption(PersistentObjectConverter::class, PersistentObjectConverter::CONFIGURATION_TARGET_TYPE, $targetType); } }