| Conditions | 4 |
| Paths | 6 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4.016 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 15 | public function getClassNameFromEntityName($entityname) |
|
| 18 | { |
||
| 19 | 15 | $entities = $this->em->getConfiguration()->getMetadataDriverImpl()->getAllClassNames(); |
|
| 20 | 15 | $entityclassname = ""; |
|
| 21 | 15 | foreach ($entities as $entity) { |
|
| 22 | 15 | $parti = explode("\\", $entity); |
|
| 23 | 15 | if ($parti[count($parti) - 1] == $entityname) { |
|
| 24 | 15 | $entityclassname = $entity; |
|
| 25 | } |
||
| 26 | } |
||
| 27 | 15 | if (!$entityclassname) { |
|
| 28 | throw new \Exception("Non riesco a trovare l'entità '" . $entityname . "', è stata generata?"); |
||
| 29 | } |
||
| 30 | 15 | return $entityclassname; |
|
| 31 | } |
||
| 33 |