| Total Complexity | 6 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class Characteristic implements HasMemento |
||
| 12 | { |
||
| 13 | const FARMING_TYPE = 'farming'; |
||
| 14 | const CROPPING_SYSTEM = 'croppingSystem'; |
||
| 15 | const DEPARTMENT = 'department'; |
||
| 16 | |||
| 17 | private $title; |
||
| 18 | private $type; |
||
| 19 | private $visible; |
||
| 20 | private $id; |
||
| 21 | private $pageId; |
||
| 22 | private $icon = null; |
||
| 23 | |||
| 24 | public function __construct(string $id, string $type, string $title, bool $visible, int $pageId = null) |
||
| 25 | { |
||
| 26 | $this->id = $id; |
||
| 27 | $this->pageId = $pageId; |
||
| 28 | $this->type = $type; |
||
| 29 | $this->title = $title; |
||
| 30 | $this->visible = $visible; |
||
| 31 | } |
||
| 32 | |||
| 33 | public function create(string $icon = null) |
||
| 40 | } |
||
| 41 | |||
| 42 | public function memento(): Memento |
||
| 43 | { |
||
| 44 | return new CharacteristicMemento($this->id, $this->type, $this->title, $this->visible, $this->icon, $this->pageId); |
||
| 45 | } |
||
| 46 | |||
| 47 | public function id(): string |
||
| 48 | { |
||
| 49 | return $this->id; |
||
| 50 | } |
||
| 51 | |||
| 52 | public function pageId(): ?int |
||
| 55 | } |
||
| 56 | } |
||
| 57 |