Reputation: 3530
I need a field for store only a year, not a complete date. Can I manage mysql YEAR type with doctrine 2?
Upvotes: 3
Views: 3962
Reputation: 6927
That mapping doesn't currently exist. You will have to use a string or a date field. Or create you own mapping. I don't know the exact steps needed. But these references can hopefully help.
Upvotes: 3
Reputation: 1543
I tried it and work fine:
/**
* @var \Year
*
* @ORM\Column(name="year_born", columnDefinition="YEAR", nullable=false)
*/
private $yearBorn;
Upvotes: 0