| @@ 27-35 (lines=9) @@ | ||
| 24 | { |
|
| 25 | $data = (array) $data; |
|
| 26 | $class = Entity::class; |
|
| 27 | foreach ($this->getMapper()->getPlugins() as $plugin) { |
|
| 28 | $entityClass = $plugin->getEntityClass($this->space); |
|
| 29 | if ($entityClass) { |
|
| 30 | if ($class != Entity::class) { |
|
| 31 | throw new Exception('Entity class override'); |
|
| 32 | } |
|
| 33 | $class = $entityClass; |
|
| 34 | } |
|
| 35 | } |
|
| 36 | ||
| 37 | if (array_key_exists(0, $data)) { |
|
| 38 | $byType = []; |
|
| @@ 164-172 (lines=9) @@ | ||
| 161 | } |
|
| 162 | ||
| 163 | $class = Entity::class; |
|
| 164 | foreach ($this->getMapper()->getPlugins() as $plugin) { |
|
| 165 | $entityClass = $plugin->getEntityClass($this->space); |
|
| 166 | if ($entityClass) { |
|
| 167 | if ($class != Entity::class) { |
|
| 168 | throw new Exception('Entity class override'); |
|
| 169 | } |
|
| 170 | $class = $entityClass; |
|
| 171 | } |
|
| 172 | } |
|
| 173 | ||
| 174 | $instance = new $class($this); |
|
| 175 | ||