blob: 7c2caa906dca8f63918b841b6b9b848f57b5f5c2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<?php
// src/model/entities/Log.php
declare(strict_types=1);
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
#[ORM\Entity]
#[ORM\Table(name: TABLE_PREFIX . "log")]
class Log
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: "integer")]
private int $id_log;
#[ORM\Column(type: 'datetime', options: ['default' => 'CURRENT_TIMESTAMP'])]
//#[ORM\Column(type: 'datetime', columnDefinition: "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")]
private ?\DateTime $date_time ; // le type datetime de doctrine convertit en type \DateTime de PHP
public function __construct(){
$this->date_time = new \DateTime();
}
}
|