| Total Complexity | 9 |
| Total Lines | 74 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class Relation |
||
| 13 | { |
||
| 14 | public const MANY_TO_ONE = 'ManyToOne'; |
||
| 15 | public const ONE_TO_MANY = 'OneToMany'; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | private $serializedKey; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var string |
||
| 24 | */ |
||
| 25 | private $type; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | private $targetEntity; |
||
| 31 | |||
| 32 | public function __construct( |
||
| 33 | string $serializedKey, |
||
| 34 | string $type, |
||
| 35 | string $targetEntity |
||
| 36 | ) { |
||
| 37 | $this->serializedKey = $serializedKey; |
||
| 38 | $this->type = $type; |
||
| 39 | $this->targetEntity = $targetEntity; |
||
| 40 | } |
||
| 41 | |||
| 42 | public function getSerializedKey(): string |
||
| 45 | } |
||
| 46 | |||
| 47 | public function setSerializedKey(string $serializedKey): self |
||
| 52 | } |
||
| 53 | |||
| 54 | public function getType(): string |
||
| 55 | { |
||
| 56 | return $this->type; |
||
| 57 | } |
||
| 58 | |||
| 59 | public function setType(string $type): self |
||
| 64 | } |
||
| 65 | |||
| 66 | public function isOneToMany(): bool |
||
| 67 | { |
||
| 68 | return self::ONE_TO_MANY === $this->getType(); |
||
| 69 | } |
||
| 70 | |||
| 71 | public function isManyToOne(): bool |
||
| 72 | { |
||
| 73 | return self::MANY_TO_ONE === $this->getType(); |
||
| 74 | } |
||
| 75 | |||
| 76 | public function getTargetEntity(): string |
||
| 77 | { |
||
| 78 | return $this->targetEntity; |
||
| 79 | } |
||
| 80 | |||
| 81 | public function setTargetEntity(string $targetEntity): self |
||
| 86 | } |
||
| 87 | } |
||
| 88 |