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

FeatureColumnsItem::getDescription()   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\Feature\Columns;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Silverback\ApiComponentBundle\Entity\Component\Feature\AbstractFeatureItem;
7
use Silverback\ApiComponentBundle\Entity\Component\FileInterface;
8
use Silverback\ApiComponentBundle\Entity\Component\FileTrait;
9
use Symfony\Component\Serializer\Annotation\Groups;
10
use Symfony\Component\Validator\Constraints as Assert;
11
use Symfony\Component\Validator\Mapping\ClassMetadata;
12
13
/**
14
 * Class FeatureColumnsItem
15
 * @package Silverback\ApiComponentBundle\Entity\Component\FeatureList
16
 * @author Daniel West <[email protected]>
17
 * @ORM\Entity()
18
 */
19
class FeatureColumnsItem extends AbstractFeatureItem implements FileInterface
20
{
21
    use FileTrait;
22
23
    /**
24
     * @ORM\Column()
25
     * @Groups({"component", "content"})
26
     * @var null|string
27
     */
28
    protected $description;
29
30
    public static function loadValidatorMetadata(ClassMetadata $metadata)
31
    {
32
        $metadata->addPropertyConstraint(
33
            'filePath',
34
            new Assert\Image()
35
        );
36
    }
37
38
    /**
39
     * @return null|string
40
     */
41
    public function getDescription(): ?string
42
    {
43
        return $this->description;
44
    }
45
46
    /**
47
     * @param null|string $description
48
     */
49
    public function setDescription(?string $description): void
50
    {
51
        $this->description = $description;
52
    }
53
}
54