zend-blog-3-backend

Форк
0
/
EmailSubscriptionSettings.php 
96 строк · 1.8 Кб
1
<?php
2

3
namespace App\Entity;
4

5
use App\Entity\Traits\ModifyEntityTrait;
6
use Doctrine\ORM\Mapping as ORM;
7

8
/**
9
 * @ORM\Table(name="subscription_settings", uniqueConstraints={
10
 *   @ORM\UniqueConstraint(columns={"email", "subs_type"})
11
 * })
12
 * @ORM\Entity(repositoryClass="App\Repository\EmailSubscriptionSettingsRepository")
13
 * @ORM\HasLifecycleCallbacks()
14
 */
15
class EmailSubscriptionSettings
16
{
17
    use ModifyEntityTrait;
18

19
    public const TYPE_COMMENT_REPLY = 1;
20

21
    /**
22
     * @var int
23
     *
24
     * @ORM\Id
25
     * @ORM\Column(type="integer")
26
     * @ORM\GeneratedValue(strategy="AUTO")
27
     */
28
    private $id;
29

30
    /**
31
     * @var string
32
     *
33
     * @ORM\Column(type="string", length=64)
34
     */
35
    private $email;
36

37
    /**
38
     * @var bool
39
     *
40
     * @ORM\Column(type="boolean", options={"default": false})
41
     */
42
    private $blockSending = false;
43

44
    /**
45
     * @var int
46
     *
47
     * @ORM\Column(type="smallint", name="subs_type", options={"default": 1, "comment":"1: reply"})
48
     */
49
    private $type = self::TYPE_COMMENT_REPLY;
50

51
    public function __construct()
52
    {
53
        $this->timeCreated = new \DateTime();
54
    }
55

56
    public function getId()
57
    {
58
        return $this->id;
59
    }
60

61
    public function getEmail()
62
    {
63
        return $this->email;
64
    }
65

66
    public function setEmail(string $email): self
67
    {
68
        $this->email = $email;
69

70
        return $this;
71
    }
72

73
    public function isBlockSending(): bool
74
    {
75
        return $this->blockSending;
76
    }
77

78
    public function setBlockSending(bool $block): self
79
    {
80
        $this->blockSending = $block;
81

82
        return $this;
83
    }
84

85
    public function getType(): int
86
    {
87
        return $this->type;
88
    }
89

90
    public function setType(int $type): self
91
    {
92
        $this->type = $type;
93

94
        return $this;
95
    }
96
}
97

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.