blob: eeb76e44250014ff9f67be11191aaa851bf77afa (
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
29
|
<?php
// src/model/entities/Log.php
declare(strict_types=1);
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[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'])] // CURRENT_TIMESTAMP "inutile", date générée par PHP
private \DateTime $date_time; // type datetime de doctrine <=> type \DateTime de PHP
#[ORM\Column(type: "boolean")]
private bool $success;
public function __construct(bool $success){
$this->date_time = new \DateTime;
$this->success = $success;
}
}
|