Issues (97)

src/Entity/PrivacyPolicy.php (1 issue)

1
<?php
2
3
namespace App\Entity;
4
5
use DateTime;
6
use Doctrine\ORM\Mapping as ORM;
7
use Gedmo\Mapping\Annotation as Gedmo;
8
use Ramsey\Uuid\Uuid;
9
use Symfony\Component\Validator\Constraints as Assert;
10
11
#[ORM\Entity]
12
class PrivacyPolicy {
13
14
    use IdTrait;
15
    use UuidTrait;
16
17
    #[ORM\Column(type: 'text')]
18
    #[Assert\NotBlank]
19
    private ?string $content = null;
20
21
    #[ORM\Column(type: 'datetime')]
22
    #[Gedmo\Timestampable(on: 'create')]
23
    private ?DateTime $changedAt = null;
24
25
    public function __construct() {
26
        $this->uuid = Uuid::uuid4();
27
    }
28
29
    public function setChangedAt(DateTime $dateTime): PrivacyPolicy {
30
        $this->changedAt = $dateTime;
31
        return $this;
32
    }
33
34
    public function getChangedAt(): DateTime {
35
        return $this->changedAt;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->changedAt could return the type null which is incompatible with the type-hinted return DateTime. Consider adding an additional type-check to rule them out.
Loading history...
36
    }
37
    public function getContent(): ?string {
38
        return $this->content;
39
    }
40
41
    public function setContent(?string $content): PrivacyPolicy {
42
        $this->content = $content;
43
        return $this;
44
    }
45
}