Ali
Ali

Reputation: 3081

What is the correct Doctrin's column type for MySql's YEAR type

I want to map a property from one of my doctrine's entity to a table's column with datatype of YEAR.

At the moment I'm using the doctrine's integer type with the length of 4 as demonstrated bellow, but I was wondering if there is a better match for such mapping.

/**
 * @var integer
 *
 * @ORM\Column(name="year", type="integer", length=4, nullable=true)
 */
private $year;

Upvotes: 0

Views: 272

Answers (1)

Aron Grzywaczewski
Aron Grzywaczewski

Reputation: 88

Any exact numeric type should be ok

Upvotes: 1

Related Questions