Test Failed
Push — develop ( b13210...c32797 )
by Daniel
04:26
created

Collection::getTitle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Silverback\ApiComponentBundle\Entity\Component\Collection;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Silverback\ApiComponentBundle\Entity\Component\AbstractComponent;
7
use Symfony\Component\Serializer\Annotation\Groups;
8
9
/**
10
 * @ORM\Entity()
11
 * @author Daniel West <[email protected]>
12
 */
13
class Collection extends AbstractComponent
14
{
15
    /**
16
     * @ORM\Column()
17
     * @Groups({"component", "content"})
18
     * @var string
19
     */
20
    private $resource;
21
22
    /**
23
     * @ORM\Column(type="integer")
24
     * @Groups({"component", "content"})
25
     * @var int
26
     */
27
    private $perPage = 12;
28
29
    /**
30
     * @ORM\Column(nullable=true)
31
     * @Groups({"component", "content"})
32
     * @var string|null
33
     */
34
    private $title;
35
36
    /**
37
     * @var array|\Traversable
38
     * @Groups({"component_read", "content_read"})
39
     */
40
    private $collection;
41
42
    /**
43
     * @return string
44
     */
45
    public function getResource(): string
46
    {
47
        return $this->resource;
48
    }
49
50
    /**
51
     * @param string $resource
52
     */
53
    public function setResource(string $resource): void
54
    {
55
        $this->resource = $resource;
56
    }
57
58
    /**
59
     * @return int
60
     */
61
    public function getPerPage(): int
62
    {
63
        return $this->perPage;
64
    }
65
66
    /**
67
     * @param int $perPage
68
     */
69
    public function setPerPage(int $perPage): void
70
    {
71
        $this->perPage = $perPage;
72
    }
73
74
    /**
75
     * @return null|string
76
     */
77
    public function getTitle(): ?string
78
    {
79
        return $this->title;
80
    }
81
82
    /**
83
     * @param null|string $title
84
     */
85
    public function setTitle(?string $title): void
86
    {
87
        $this->title = $title;
88
    }
89
90
    /**
91
     * @return array|\Traversable
92
     */
93
    public function getCollection()
94
    {
95
        return $this->collection;
96
    }
97
98
    /**
99
     * @param array|\Traversable $collection
100
     */
101
    public function setCollection($collection): void
102
    {
103
        $this->collection = $collection;
104
    }
105
106
    /**
107
     * @ORM\PostLoad()
108
     */
109
    public function postLoad()
110
    {
111
    }
112
}
113