src/CarteBlanche/Library/AutoObject/AutoObjectMapper.php
protected function buildEntityName($name = null)
    {
        if (empty($name)) {
            $_name = CarteBlanche::getContainer()->get('request')->getUrlArg('altdb');
            if (!empty($_name))
                $name = $_name;
            else
                $name = 'default';
        }
        if (substr_count($name, '_base')) {
            $_name = CarteBlanche::getKernel()->getRegistry()->getStackKey( $name, 'db_name', 'config' );
            if (empty($_name))
                $_name = CarteBlanche::getKernel()->getRegistry()->getStackKey( $name, 'db_name', 'app' );
            if (!empty($_name))
                $name = $_name;
        }
        return str_replace(array('_database', '_entity_manager', '_base'), '', $name);
    }
protected function buildEntityName($name = null)
    {
        if (empty($name)) {
            $_name = CarteBlanche::getContainer()->get('request')->getUrlArg('altdb');
            if (!empty($_name))
                $name = $_name;
            else
                $name = 'default';
        }
        if (substr_count($name, '_base')) {
            $_name = CarteBlanche::getKernel()->getRegistry()->getStackKey( $name, 'db_name', 'config' );
            if (empty($_name))
                $_name = CarteBlanche::getKernel()->getRegistry()->getStackKey( $name, 'db_name', 'app' );
            if (!empty($_name))
                $name = $_name;
        }
        return str_replace(array('_database', '_entity_manager', '_base'), '', $name);
    }
Transform the name of an entity (skipping '..._db' and '..._em' suffix or retrieving it if '..._base')
@param string $dbname The name of the database to search
@return string The re-formed name if so