| Total Complexity | 4 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 15 | #[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor] |
||
| 16 | final class Embedded extends Relation |
||
| 17 | { |
||
| 18 | protected const TYPE = 'embedded'; |
||
| 19 | protected ?string $embeddedPrefix = null; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param non-empty-string $target Entity to embed. |
||
|
|
|||
| 23 | * @param non-empty-string $load Relation load approach. |
||
| 24 | * @param non-empty-string|null $prefix Prefix for embedded entity columns. |
||
| 25 | */ |
||
| 26 | 36 | public function __construct( |
|
| 27 | string $target, |
||
| 28 | #[ExpectedValues(values: ['lazy', 'eager'])] |
||
| 29 | string $load = 'eager', |
||
| 30 | ?string $prefix = null, |
||
| 31 | ) { |
||
| 32 | 36 | $this->embeddedPrefix = $prefix; |
|
| 33 | |||
| 34 | 36 | parent::__construct($target, $load); |
|
| 35 | 36 | } |
|
| 36 | |||
| 37 | 36 | public function getInverse(): ?Inverse |
|
| 38 | { |
||
| 39 | 36 | return null; |
|
| 40 | } |
||
| 41 | |||
| 42 | 36 | public function getPrefix(): ?string |
|
| 43 | { |
||
| 44 | 36 | return $this->embeddedPrefix; |
|
| 45 | } |
||
| 46 | |||
| 47 | 36 | public function setPrefix(string $prefix): self |
|
| 52 | } |
||
| 53 | } |
||
| 54 |