Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | public function get(string $id): Entity |
||
26 | { |
||
27 | if ($this->has($id)) { |
||
28 | return parent::get($id); |
||
29 | } |
||
30 | |||
31 | if (! isset($this->metadataConfig[$id])) { |
||
32 | throw new Error( |
||
33 | 'Entity ' . $id . ' is not mapped in the metadata', |
||
34 | ); |
||
35 | } |
||
36 | |||
37 | return $this->build(Entity::class, $id, $this->metadataConfig[$id]); |
||
38 | } |
||
45 |