我如何将(cuurent_time)默认值赋给变量($ dateajout)
/**
* @var \DateTime
*
* @ORM\Column(name="dateajout", type="datetime" , nullable=true)
*/
private $dateajout;
答案 0 :(得分:1)
你试过这个:
class Dummy
{
/**
* @var \DateTime
*
* @ORM\Column(name="dateajout", type="datetime" , nullable=true)
*/
private $dateajout;
public function __construct()
{
$this->dateajout = new \DateTime();
}
}