Passed
Push — master ( 8b2dd4...a86b29 )
by Dev
09:20
created

PageExtendedTrait::getChildrenPages()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace PiedWeb\CMSBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Gedmo\Mapping\Annotation as Gedmo;
7
8
/**
9
 * Page extended: // I may cut this in multiple traits
10
 * - meta no-index
11
 * - Rich Content (meta desc, parentPage, h1, name [to do short link] )
12
 * - author (link)
13
 * - template.
14
 */
15
trait PageExtendedTrait
16
{
17
    /**
18
     * @Gedmo\Translatable
19
     * @ORM\Column(type="string", length=255, nullable=true)
20
     */
21
    protected $excrept;
22
23
    /**
24
     * @Gedmo\Translatable
25
     * @ORM\Column(type="string", length=50, nullable=true)
26
     */
27
    protected $metaRobots;
28
29
    /**
30
     * @ORM\ManyToOne(targetEntity="PiedWeb\CMSBundle\Entity\PageInterface", inversedBy="childrenPages")
31
     */
32
    protected $parentPage;
33
34
    /**
35
     * @ORM\OneToMany(targetEntity="PiedWeb\CMSBundle\Entity\PageInterface", mappedBy="parentPage")
36
     */
37
    protected $childrenPages;
38
39
    /**
40
     * @Gedmo\Translatable
41
     * @ORM\Column(type="string", length=255, nullable=true)
42
     */
43
    protected $h1;
44
45
    /**
46
     * @Gedmo\Translatable
47
     * @ORM\Column(type="string", length=150, nullable=true)
48
     */
49
    protected $name;
50
51
    /**
52
     * @ORM\ManyToOne(targetEntity="PiedWeb\CMSBundle\Entity\UserInterface")
53
     */
54
    protected $author;
55
56
    /**
57
     * @ORM\Column(type="string", length=250, nullable=true)
58
     */
59
    protected $template;
60
61 3
    public function __constructExtended()
62
    {
63 3
    }
64
65
    public function getExcrept(): ?string
66
    {
67
        return $this->excrept;
68
    }
69
70
    public function setExcrept(?string $excrept): self
71
    {
72
        $this->excrept = $excrept;
73
74
        return $this;
75
    }
76
77
    public function getMetaRobots(): ?string
78
    {
79
        return $this->metaRobots;
80
    }
81
82
    public function setMetaRobots(?string $metaRobots): self
83
    {
84
        $this->metaRobots = $metaRobots;
85
86
        return $this;
87
    }
88
89
    public function getParentPage(): ?self
90
    {
91
        return $this->parentPage;
92
    }
93
94
    public function setParentPage(?self $parentPage): self
95
    {
96
        $this->parentPage = $parentPage;
97
98
        return $this;
99
    }
100
101
    public function getChildrenPages()
102
    {
103
        return $this->childrenPages;
104
    }
105
106
    public function getH1(): ?string
107
    {
108
        return $this->h1;
109
    }
110
111
    public function setH1(?string $h1): self
112
    {
113
        $this->h1 = $h1;
114
115
        return $this;
116
    }
117
118
    public function getName(): ?string
119
    {
120
        return $this->name;
121
    }
122
123
    public function setName(?string $name): self
124
    {
125
        $this->name = $name;
126
127
        return $this;
128
    }
129
130
    public function getAuthor(): ?User
131
    {
132
        return $this->author;
133
    }
134
135
    public function setAuthor(?User $author): self
136
    {
137
        $this->author = $author;
138
139
        return $this;
140
    }
141
142
    public function getTemplate(): ?string
143
    {
144
        return $this->template;
145
    }
146
147
    public function setTemplate(?string $template): self
148
    {
149
        $this->template = $template;
150
151
        return $this;
152
    }
153
}
154