Total Complexity | 3 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 50% |
Changes | 0 |
1 | <?php |
||
19 | class SimpleImage extends AbstractComponent implements FileInterface |
||
20 | { |
||
21 | use FileTrait; |
||
22 | |||
23 | /** |
||
24 | * @ORM\Column(nullable=true) |
||
25 | * @Groups({"component", "content"}) |
||
26 | * @var null|string |
||
27 | */ |
||
28 | protected $caption; |
||
29 | |||
30 | /** |
||
31 | * @param ClassMetadata $metadata |
||
32 | */ |
||
33 | 1 | public static function loadValidatorMetadata(ClassMetadata $metadata) |
|
34 | { |
||
35 | 1 | $metadata->addPropertyConstraints( |
|
36 | 1 | 'filePath', |
|
37 | 1 | [new Assert\NotBlank()] // , new Assert\Image() |
|
38 | ); |
||
39 | 1 | } |
|
40 | |||
41 | /** |
||
42 | * @return null|string |
||
43 | */ |
||
44 | public function getCaption(): ?string |
||
45 | { |
||
46 | return $this->caption; |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @param null|string $caption |
||
51 | * @return SimpleImage |
||
52 | */ |
||
53 | public function setCaption(?string $caption): self |
||
57 | } |
||
58 | } |
||
59 |