I'm working in php laravel framework. I'm trying to add customized form fields in a page where the form field can be added dynamically.
in created Entity class (Test.php)
$class->property($this->enquiryAdditionalFields)->asType(AdditionalFormFields::collectionType());
AdditionalFormFields is an ValueObject type class, where I have defined the field name.
in created EntityMapper class (TestMapper.php):
$map->embeddedCollection(TEST::ENQUIRY_ADDITIONAL_FIELDS)
->toTable('enquery_additional_field')
->withPrimaryKey('id')
->withForeignKeyToParentAs('event_id')
->using(new AdditionalFormFieldsMapper());
AdditionalFormFieldsMapper class:
class AdditionalFormFieldsMapper extends IndependentValueObjectMapper
{
/**
* @param MapperDefinition $map
* @throws \Core\Exception\InvalidArgumentException
*/
protected function define(MapperDefinition $map)
{
$map->type(AdditionalFormFields::class);
$map->property(AdditionalFormFields::FIELD_NAME)->to('field_name')->asVarchar(255);
}
}
while adding a new field, I'm getting error as
"Could not handle action exception of type Doctrine\DBAL\Exception\NotNullConstraintViolationException from action 'edit': no matching action handler could be found"