src/ORM/DataObjectSchema.php
protected function buildTableName($class)
    {
        $table = Config::inst()->get($class, 'table_name', Config::UNINHERITED);

        // Generate default table name
        if ($table) {
            return $table;
        }

        if (strpos($class, '\\') === false) {
            return $class;
        }

        $separator = DataObjectSchema::config()->uninherited('table_namespace_separator');
        $table = str_replace('\\', $separator, trim($class, '\\'));

        if (!ClassInfo::classImplements($class, TestOnly::class) && $this->classHasTable($class)) {
            DBSchemaManager::showTableNameWarning($table, $class);
        }

        return $table;
    }
protected function buildTableName($class)
    {
        $table = Config::inst()->get($class, 'table_name', Config::UNINHERITED);

        // Generate default table name
        if ($table) {
            return $table;
        }

        if (strpos($class, '\\') === false) {
            return $class;
        }

        $separator = DataObjectSchema::config()->uninherited('table_namespace_separator');
        $table = str_replace('\\', $separator, trim($class, '\\'));

        if (!ClassInfo::classImplements($class, TestOnly::class) && $this->classHasTable($class)) {
            DBSchemaManager::showTableNameWarning($table, $class);
        }

        return $table;
    }
protected function buildTableName ( $ class ) { $ table = Config :: inst ( ) -> get ( $ class , 'table_name' , Config :: UNINHERITED ) ; // Generate default table name if ( $ table ) { return $ table ; } if ( strpos ( $ class , '\\' ) === false ) { return $ class ; } $ separator = DataObjectSchema :: config ( ) -> uninherited ( 'table_namespace_separator' ) ; $ table = str_replace ( '\\' , $ separator , trim ( $ class , '\\' ) ) ; if ( ! ClassInfo :: classImplements ( $ class , TestOnly :: class ) && $ this -> classHasTable ( $ class ) ) { DBSchemaManager :: showTableNameWarning ( $ table , $ class ) ; } return $ table ; }
Generate table name for a class.

Note: some DB schema have a hard limit on table name length. This is not enforced by this method.
See dev/build errors for details in case of table name violation.

@param string $class

@return string
Generate table name for a class .