Doctrine - add custom info to column entity

11 Views Asked by At

I have an entity (managed with Doctrine) that is the result of an import of a CSV file; there is a one-to-one correspondence between the CSV column and the table column. How can I add the name of CSV column to the column definition ?

Now I have used the comment option

@ORM\Column(type="string", length=20, options={"comment":"Stato"))

But I think there is a better way. Please note that I am now using PHP 7.4 (without attributes) but I will upgrade soon to PHP version 8.

Thanks in advance

0

There are 0 best solutions below