Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
0.00% |
0 / 23 |
n/a |
0 / 0 |
n/a |
0 / 0 |
|
0.00% |
0 / 9 |
CRAP | |
0.00% |
0 / 1 |
||
| DoctrineSet | |
0.00% |
0 / 23 |
n/a |
0 / 0 |
n/a |
0 / 0 |
|
0.00% |
0 / 9 |
90 | |
0.00% |
0 / 1 |
||
| __construct | |
0.00% |
0 / 7 |
n/a |
0 / 0 |
n/a |
0 / 0 |
|
0.00% |
0 / 1 |
2 | |||||
| getId | |
0.00% |
0 / 1 |
n/a |
0 / 0 |
n/a |
0 / 0 |
|
0.00% |
0 / 1 |
2 | |||||
| getExternalId | |
0.00% |
0 / 1 |
n/a |
0 / 0 |
n/a |
0 / 0 |
|
0.00% |
0 / 1 |
2 | |||||
| getLegoId | |
0.00% |
0 / 1 |
n/a |
0 / 0 |
n/a |
0 / 0 |
|
0.00% |
0 / 1 |
2 | |||||
| getName | |
0.00% |
0 / 1 |
n/a |
0 / 0 |
n/a |
0 / 0 |
|
0.00% |
0 / 1 |
2 | |||||
| getPartCount | |
0.00% |
0 / 1 |
n/a |
0 / 0 |
n/a |
0 / 0 |
|
0.00% |
0 / 1 |
2 | |||||
| getImagePath | |
0.00% |
0 / 1 |
n/a |
0 / 0 |
n/a |
0 / 0 |
|
0.00% |
0 / 1 |
2 | |||||
| getProductionYear | |
0.00% |
0 / 1 |
n/a |
0 / 0 |
n/a |
0 / 0 |
|
0.00% |
0 / 1 |
2 | |||||
| toDomain | |
0.00% |
0 / 9 |
n/a |
0 / 0 |
n/a |
0 / 0 |
|
0.00% |
0 / 1 |
2 | |||||
| 1 | <?php |
| 2 | |
| 3 | namespace App\CollectionManagement\Infrastructure\Persistence\Doctrine\Entity; |
| 4 | |
| 5 | use App\CollectionManagement\Domain\Model\Local\Set; |
| 6 | use App\Shared\Domain\Model\EntityId; |
| 7 | use Doctrine\ORM\Mapping as ORM; |
| 8 | |
| 9 | /** |
| 10 | * @ORM\Entity |
| 11 | * @ORM\Table(name="sets") |
| 12 | */ |
| 13 | class DoctrineSet |
| 14 | { |
| 15 | #[ORM\Id, ORM\Column(type: "string")] |
| 16 | private string $id; |
| 17 | |
| 18 | // TODO : uniqueness |
| 19 | #[ORM\Column(unique: true)] |
| 20 | private string $externalId; |
| 21 | |
| 22 | #[ORM\Column] |
| 23 | private string $legoId; |
| 24 | |
| 25 | #[ORM\Column] |
| 26 | private string $name; |
| 27 | |
| 28 | #[ORM\Column] |
| 29 | private int $partCount; |
| 30 | |
| 31 | #[ORM\Column] |
| 32 | private string $imagePath; |
| 33 | |
| 34 | #[ORM\Column] |
| 35 | private int $productionYear; |
| 36 | |
| 37 | public function __construct( |
| 38 | string $id, |
| 39 | string $externalId, |
| 40 | string $legoId, |
| 41 | string $name, |
| 42 | int $partCount, |
| 43 | string $imagePath, |
| 44 | int $productionYear |
| 45 | ) { |
| 46 | $this->id = $id; |
| 47 | $this->externalId = $externalId; |
| 48 | $this->legoId = $legoId; |
| 49 | $this->name = $name; |
| 50 | $this->partCount = $partCount; |
| 51 | $this->imagePath = $imagePath; |
| 52 | $this->productionYear = $productionYear; |
| 53 | } |
| 54 | |
| 55 | public function getId(): string |
| 56 | { |
| 57 | return $this->id; |
| 58 | } |
| 59 | |
| 60 | public function getExternalId(): string |
| 61 | { |
| 62 | return $this->externalId; |
| 63 | } |
| 64 | |
| 65 | public function getLegoId(): string |
| 66 | { |
| 67 | return $this->legoId; |
| 68 | } |
| 69 | |
| 70 | public function getName(): string |
| 71 | { |
| 72 | return $this->name; |
| 73 | } |
| 74 | |
| 75 | public function getPartCount(): int |
| 76 | { |
| 77 | return $this->partCount; |
| 78 | } |
| 79 | |
| 80 | public function getImagePath(): string |
| 81 | { |
| 82 | return $this->imagePath; |
| 83 | } |
| 84 | |
| 85 | public function getProductionYear(): int |
| 86 | { |
| 87 | return $this->productionYear; |
| 88 | } |
| 89 | |
| 90 | public function toDomain(): Set |
| 91 | { |
| 92 | return new Set( |
| 93 | EntityId::fromString($this->id), |
| 94 | $this->externalId, |
| 95 | $this->legoId, |
| 96 | $this->name, |
| 97 | $this->partCount, |
| 98 | $this->imagePath, |
| 99 | $this->productionYear |
| 100 | ); |
| 101 | } |
| 102 | } |