Browse Source

fix entity class for irregular table names

Tomas Saghy 7 years ago
parent
commit
a150b94bd6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/ORM/Table.php

+ 1 - 1
src/ORM/Table.php

@@ -773,7 +773,7 @@ class Table implements RepositoryInterface, EventListenerInterface, EventDispatc
                 return $this->_entityClass = $default;
             }
 
-            $alias = Inflector::singularize(substr(array_pop($parts), 0, -5));
+            $alias = Inflector::classify(Inflector::singularize(Inflector::underscore(substr(array_pop($parts), 0, -5))));
             $name = implode('\\', array_slice($parts, 0, -1)) . '\\Entity\\' . $alias;
             if (!class_exists($name)) {
                 return $this->_entityClass = $default;