Lines
85.71%
12 / 14
Functions and Methods
71.42%
5 / 7
Classes and Traits
0.00%
0 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| RequestRelation | 85.71% | 12 / 14 | 71.42% | 5 / 7 | 7.14 | 0.00% | 0 / 1 | |||
| getDefaults | 100.00% | 8 / 8 | 100.00% | 1 / 1 | 1 | |||||
| getRequest | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| getProvider | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| getSlotCount | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| getMaxQuantity | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | |||||
| isPublic | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | |||||
| getSource | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | namespace BO\Zmsentities; | |
| 4 | ||
| 5 | class RequestRelation extends Schema\Entity | |
| 6 | { | |
| 7 | public static $schema = "requestrelation.json"; | |
| 8 | ||
| 9 | /** | |
| 10 | * @return (Provider|Request|null|string|true)[] | |
| 11 | * | |
| 12 | */ | |
| 13 | #[\Override] | |
| 14 | public function getDefaults() | |
| 15 | { | |
| 16 | return [ | |
| 17 | 'provider' => new Provider(), | |
| 18 | 'request' => new Request(), | |
| 19 | 'source' => null, | |
| 20 | 'slots' => '1', | |
| 21 | 'public' => true, | |
| 22 | 'maxQuantity' => null, | |
| 23 | ]; | |
| 24 | } | |
| 25 | ||
| 26 | public function getRequest(): mixed | |
| 27 | { | |
| 28 | return $this->toProperty()->request->get(); | |
| 29 | } | |
| 30 | ||
| 31 | public function getProvider(): mixed | |
| 32 | { | |
| 33 | return $this->toProperty()->provider->get(); | |
| 34 | } | |
| 35 | ||
| 36 | public function getSlotCount(): mixed | |
| 37 | { | |
| 38 | return $this->toProperty()->slots->get(); | |
| 39 | } | |
| 40 | ||
| 41 | public function getMaxQuantity(): mixed | |
| 42 | { | |
| 43 | return $this->toProperty()->maxQuantity->get(); | |
| 44 | } | |
| 45 | ||
| 46 | public function isPublic(): bool | |
| 47 | { | |
| 48 | return (bool) $this->toProperty()->public->get(); | |
| 49 | } | |
| 50 | ||
| 51 | public function getSource(): mixed | |
| 52 | { | |
| 53 | return $this->toProperty()->source->get(); | |
| 54 | } | |
| 55 | } |