-
Notifications
You must be signed in to change notification settings - Fork 125
Closed
Description
My xlsx has a column Sollkto which will be mapped to my entity property creditAccount
$converter = new MappingItemConverter();
$converter
->addMapping('Sollkto', 'creditAccount')
;Which is an ManyToOne association:
/**
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\AccountsCode", inversedBy="creditAccountJournals")
* @ORM\JoinColumn(name="credit_account_id", referencedColumnName="id", nullable=true)
*/
private $creditAccount;The value in my xlsx is 135. When reading the row the column in converted into a double: 135.0
Error:
Expected value of type "AppBundle\Entity\AccountsCode" for association field "AppBundle\Entity\Journal#$creditAccount", got "double" instead.
Is this the expected behaviour? It works converting the value via StringToObjectConverter?
$creditAccountConverter = new StringToObjectConverter($creditAccountRepository, 'id');
$workflow->addValueConverter('creditAccount', $creditAccountConverter);But isn't there an automatic process resp. is the ExcelReader reading a double an issue?
Possibly related:
Metadata
Metadata
Assignees
Labels
No labels