Completed
Push — master ( 8253ba...a023d2 )
by Daniel
16:49 queued 05:23
created

FeatureTextList::createItem()   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\Component\Feature\TextList;
4
5
use ApiPlatform\Core\Annotation\ApiResource;
6
use Doctrine\ORM\Mapping as ORM;
7
use Silverback\ApiComponentBundle\Entity\Component\Feature\AbstractFeature;
8
use Silverback\ApiComponentBundle\Entity\Component\Feature\FeatureItemInterface;
9
use Symfony\Component\Serializer\Annotation\Groups;
10
11
/**
12
 * Class FeatureTextList
13
 * @package Silverback\ApiComponentBundle\Entity\Component\FeatureList
14
 * @author Daniel West <[email protected]>
15
 * @ApiResource(shortName="component/feature_text_lists")
16
 * @ORM\Entity()
17
 */
18
class FeatureTextList extends AbstractFeature
19
{
20
    /**
21
     * @Groups({"component", "content"})
22
     * @var int
23
     */
24
    protected $columns = 3;
25
26
    /**
27
     * @Groups({"component", "content"})
28
     * @var null|string
29
     */
30
    protected $title;
31
32
    /**
33
     * @return FeatureItemInterface
34
     */
35
    public function createItem(): FeatureItemInterface
36
    {
37
        return new FeatureTextListItem();
38
    }
39
40
    /**
41
     * @return int
42
     */
43
    public function getColumns(): int
44
    {
45
        return $this->columns;
46
    }
47
48
    /**
49
     * @param int $columns
50
     */
51
    public function setColumns(int $columns): void
52
    {
53
        $this->columns = $columns;
54
    }
55
56
    /**
57
     * @return null|string
58
     */
59
    public function getTitle(): ?string
60
    {
61
        return $this->title;
62
    }
63
64
    /**
65
     * @param null|string $title
66
     */
67
    public function setTitle(?string $title): void
68
    {
69
        $this->title = $title;
70
    }
71
}
72