Total Complexity | 6 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | final class DoctrineEntity |
||
9 | { |
||
10 | private $id; |
||
11 | private $intValue; |
||
12 | private $stringValue; |
||
13 | private $nullableValue; |
||
14 | |||
15 | public function __construct( |
||
16 | int $id, |
||
17 | DoctrineIntEnum $int, |
||
18 | DoctrineStringEnum $string, |
||
19 | ?DoctrineStringEnum $nullableString = null |
||
20 | ) { |
||
21 | $this->id = $id; |
||
22 | $this->intValue = $int; |
||
23 | $this->stringValue = $string; |
||
24 | $this->nullableValue = $nullableString; |
||
25 | } |
||
26 | |||
27 | public static function loadMetadata(ClassMetadata $metadata) |
||
28 | { |
||
29 | $metadata->setPrimaryTable(['name' => 'doctrine_entity']); |
||
30 | |||
31 | $metadata->mapField(['id' => true, 'fieldName' => 'id', 'type' => 'integer']); |
||
32 | $metadata->mapField(['fieldName' => 'intValue', 'columnName' => 'int_value', 'type' => 'intEnum']); |
||
33 | $metadata->mapField(['fieldName' => 'stringValue', 'columnName' => 'string_value', 'type' => 'stringEnum']); |
||
34 | $metadata->mapField(['fieldName' => 'nullableValue', 'columnName' => 'nullable_value', 'type' => 'stringEnum', 'nullable' => true]); |
||
35 | } |
||
36 | |||
37 | public function getId() |
||
40 | } |
||
41 | |||
42 | public function getIntValue(): DoctrineIntEnum |
||
43 | { |
||
44 | return $this->intValue; |
||
45 | } |
||
46 | |||
47 | public function getStringValue(): DoctrineStringEnum |
||
48 | { |
||
49 | return $this->stringValue; |
||
50 | } |
||
51 | |||
52 | public function getNullableValue(): ?DoctrineStringEnum |
||
55 | } |
||
56 | } |
||
57 |