Data de valor padrão Entidade Symfony
@ORM\Column(name="created_at", type="datetime", options={"default": "CURRENT_TIMESTAMP"})
Dead Dormouse
@ORM\Column(name="created_at", type="datetime", options={"default": "CURRENT_TIMESTAMP"})
/**
* @Entity
* @Table(name="...")
*/
class MyEntity
{
/** @Column(type="datetime") */
protected $registration_date;
public function __construct()
{
$this->registration_date = new DateTime();
}
}