Completed
Pull Request — master (#8)
by Nicolas
28:01
created

ContentTrait::setEnabled()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Smart\ContentBundle\Entity\Traits;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Gedmo\Timestampable\Traits\TimestampableEntity;
7
use Symfony\Component\HttpFoundation\File\File;
8
use Symfony\Component\HttpFoundation\File\UploadedFile;
9
use Vich\UploaderBundle\Mapping\Annotation as Vich;
10
use Symfony\Component\Validator\Constraints as Assert;
11
use Gedmo\Mapping\Annotation as Gedmo;
12
13
trait ContentTrait
14
{
15
    use TimestampableEntity;
16
17
    /**
18
     * @var string
19
     *
20
     * @ORM\Column(name="title", type="string", length=255)
21
     */
22
    protected $title;
23
24
    /**
25
     * @var string
26
     *
27
     * @ORM\Column(name="description", type="text", nullable=true)
28
     */
29
    protected $description;
30
31
    /**
32
     * @var string
33
     *
34
     * @ORM\Column(name="content", type="text", nullable=true)
35
     */
36
    protected $content;
37
38
    /**
39
     * @var bool
40
     *
41
     * @ORM\Column(name="enabled", type="boolean")
42
     */
43
    protected $enabled = false;
44
45
    public function __toString()
46
    {
47
        return (string) $this->getTitle();
48
    }
49
50
    /**
51
     * @return string
52
     */
53
    public function getTitle()
54
    {
55
        return $this->title;
56
    }
57
58
    /**
59
     * @param string $title
60
     */
61 1
    public function setTitle($title)
62
    {
63 1
        $this->title = $title;
64 1
    }
65
66
    /**
67
     * @return string
68
     */
69
    public function getDescription()
70
    {
71
        return $this->description;
72
    }
73
74
    /**
75
     * @param string $description
76
     */
77 1
    public function setDescription($description)
78
    {
79 1
        $this->description = $description;
80 1
    }
81
82
    /**
83
     * @return string
84
     */
85
    public function getContent()
86
    {
87
        return $this->content;
88
    }
89
90
    /**
91
     * @param string $content
92
     *
93
     * @return $this
94
     */
95 1
    public function setContent($content)
96
    {
97 1
        $this->content = $content;
98
99 1
        return $this;
100
    }
101
102
    /**
103
     * @return boolean
104
     */
105
    public function isEnabled()
106
    {
107
        return $this->enabled;
108
    }
109
110
    /**
111
     * @param boolean $enabled
112
     *
113
     * @return $this
114
     */
115 1
    public function setEnabled($enabled)
116
    {
117 1
        $this->enabled = $enabled;
118
119 1
        return $this;
120
    }
121
}
122