Passed
Push — develop ( 185343...eb895f )
by Daniel
06:30
created

Collection::postLoad()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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