Completed
Pull Request — master (#4)
by
unknown
14:30 queued 10:00
created

PageExtendedTrait   A

Complexity

Total Complexity 15

Size/Duplication

Total Lines 122
Duplicated Lines 0 %

Test Coverage

Coverage 5.56%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 28
c 1
b 0
f 0
dl 0
loc 122
ccs 2
cts 36
cp 0.0556
rs 10
wmc 15

15 Methods

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