Completed
Push — master ( 45301f...e76351 )
by Joachim
07:16
created

Event::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Loevgaard\DandomainAltapayBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Symfony\Component\Validator\Constraints as Assert;
7
use Knp\DoctrineBehaviors\Model as ORMBehaviors;
8
9
/**
10
 * @ORM\Table(name="dandomain_altapay_events")
11
 * @ORM\Entity()
12
 */
13
class Event
14
{
15
    use ORMBehaviors\Timestampable\Timestampable;
16
17
    /**
18
     * @var int
19
     *
20
     * @ORM\Id
21
     * @ORM\Column(name="id", type="integer")
22
     * @ORM\GeneratedValue(strategy="AUTO")
23
     */
24
    protected $id;
25
26
    /**
27
     * @var string
28
     *
29
     * @Assert\NotBlank()
30
     * @Assert\Length(max="191")
31
     *
32
     * @ORM\Column(type="string", length=191)
33
     */
34
    protected $name;
35
36
    /**
37
     * @var string
38
     *
39
     * @Assert\NotBlank()
40
     *
41
     * @ORM\Column(type="json")
42
     */
43
    protected $body;
44
45
    public function __construct(string $name, string $body)
46
    {
47
        $this->name = $name;
48
        $this->body = $body;
49
    }
50
51
    /**
52
     * @return int
53
     */
54
    public function getId(): ?int
55
    {
56
        return $this->id;
57
    }
58
59
    /**
60
     * @param int $id
61
     * @return Event
62
     */
63
    public function setId(int $id) : self
64
    {
65
        $this->id = $id;
66
        return $this;
67
    }
68
69
    /**
70
     * @return string
71
     */
72
    public function getName(): string
73
    {
74
        return $this->name;
75
    }
76
77
    /**
78
     * @param string $name
79
     * @return Event
80
     */
81
    public function setName(string $name) : self
82
    {
83
        $this->name = $name;
84
        return $this;
85
    }
86
87
    /**
88
     * @return string
89
     */
90
    public function getBody(): string
91
    {
92
        return $this->body;
93
    }
94
95
    /**
96
     * @param string $body
97
     * @return Event
98
     */
99
    public function setBody(string $body) : self
100
    {
101
        $this->body = $body;
102
        return $this;
103
    }
104
}
105