Passed
Push — develop ( 74761d...9bb873 )
by Daniel
06:04
created

Collection::getCollection()   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 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
9
/**
10
 * @ORM\Entity()
11
 * @ApiResource()
12
 * @author Daniel West <[email protected]>
13
 */
14
class Collection extends AbstractComponent
15
{
16
    /**
17
     * @ORM\Column()
18
     * @var string
19
     */
20
    private $resource;
21
22
    /**
23
     * @ORM\Column(type="integer")
24
     * @var int
25
     */
26
    private $perPage = 12;
27
28
    /**
29
     * @var array|\Traversable
30
     */
31
    private $collection;
32
33
    /**
34
     * @return string
35
     */
36 1
    public function getResource(): string
37
    {
38 1
        return $this->resource;
39
    }
40
41
    /**
42
     * @param string $resource
43
     */
44 1
    public function setResource(string $resource): void
45
    {
46 1
        $this->resource = $resource;
47 1
    }
48
49
    /**
50
     * @return int
51
     */
52 1
    public function getPerPage(): int
53
    {
54 1
        return $this->perPage;
55
    }
56
57
    /**
58
     * @param int $perPage
59
     */
60 1
    public function setPerPage(int $perPage): void
61
    {
62 1
        $this->perPage = $perPage;
63 1
    }
64
65
    /**
66
     * @return array|\Traversable
67
     */
68
    public function getCollection()
69
    {
70
        return $this->collection;
71
    }
72
73
    /**
74
     * @param array|\Traversable $collection
75
     */
76
    public function setCollection($collection): void
77
    {
78
        $this->collection = $collection;
79
    }
80
}
81