Lines
100.00%
8 / 8
Functions and Methods
100.00%
2 / 2
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Link | 100.00% | 8 / 8 | 100.00% | 2 / 2 | 2 | 100.00% | 1 / 1 | |||
| getDefaults | 100.00% | 7 / 7 | 100.00% | 1 / 1 | 1 | |||||
| __toString | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | namespace BO\Zmsentities; | |
| 4 | ||
| 5 | class Link extends Schema\Entity | |
| 6 | { | |
| 7 | public const string PRIMARY = 'id'; | |
| 8 | ||
| 9 | public static $schema = "link.json"; | |
| 10 | ||
| 11 | /** | |
| 12 | * @return (bool|int|string)[] | |
| 13 | * | |
| 14 | */ | |
| 15 | #[\Override] | |
| 16 | public function getDefaults() | |
| 17 | { | |
| 18 | return [ | |
| 19 | 'name' => '', | |
| 20 | 'url' => '', | |
| 21 | 'target' => true, | |
| 22 | 'public' => false, | |
| 23 | 'organisation' => 0 | |
| 24 | ]; | |
| 25 | } | |
| 26 | ||
| 27 | public function __toString() | |
| 28 | { | |
| 29 | return "Link {$this->name}-{$this->url}- with target " . $this->target; | |
| 30 | } | |
| 31 | } |