| Total Complexity | 5 |
| Total Lines | 62 |
| Duplicated Lines | 0 % |
| Coverage | 40% |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | class FeatureTextList extends AbstractFeature |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @ORM\Column() |
||
| 23 | * @Groups({"component", "content"}) |
||
| 24 | * @var null|string |
||
| 25 | */ |
||
| 26 | protected $title; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @ORM\Column() |
||
| 30 | * @Groups({"component", "content"}) |
||
| 31 | * @var int |
||
| 32 | */ |
||
| 33 | protected $columns = 3; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @param ClassMetadata $metadata |
||
| 37 | */ |
||
| 38 | 1 | public static function loadValidatorMetadata(ClassMetadata $metadata): void |
|
| 39 | { |
||
| 40 | 1 | $metadata->addPropertyConstraint( |
|
| 41 | 1 | 'columns', |
|
| 42 | 1 | new Assert\Range( |
|
| 43 | [ |
||
| 44 | 1 | 'min' => 1, |
|
| 45 | 'minMessage' => 'The FeatureColumns component must have at least 1 column' |
||
| 46 | ] |
||
| 47 | ) |
||
| 48 | ); |
||
| 49 | 1 | } |
|
| 50 | |||
| 51 | /** |
||
| 52 | * @return null|string |
||
| 53 | */ |
||
| 54 | public function getTitle(): ?string |
||
| 55 | { |
||
| 56 | return $this->title; |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @param null|string $title |
||
| 61 | */ |
||
| 62 | public function setTitle(?string $title): void |
||
| 65 | } |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @return int |
||
| 69 | */ |
||
| 70 | public function getColumns(): int |
||
| 71 | { |
||
| 72 | return $this->columns; |
||
| 73 | } |
||
| 74 | |||
| 75 | /** |
||
| 76 | * @param int $columns |
||
| 77 | */ |
||
| 78 | public function setColumns(int $columns): void |
||
| 81 | } |
||
| 82 | } |
||
| 83 |