public static function mapClassToTable($className, $dbConn = NULL)
    {
        $demarcation = strrpos($className, '\\', -1);

        if ($demarcation !== false) {
            $table = strtolower(substr($className, $demarcation + 1));
        } else {
            $table = strtolower($className);
        }

		if (is_null($dbConn)) {
			$dbConn = self::makeDbConn();
		}


        if ($table == 'user' || (! self::checkForTable($table, $dbConn))) {
            $table = self::addOrRemoveS($table);

            if (! self::checkForTable($table, $dbConn)) {
                throw new TableDoesNotExistException;
            }
        }

        return $table;
    }
public static function mapClassToTable($className, $dbConn = NULL)
    {
        $demarcation = strrpos($className, '\\', -1);

        if ($demarcation !== false) {
            $table = strtolower(substr($className, $demarcation + 1));
        } else {
            $table = strtolower($className);
        }

		if (is_null($dbConn)) {
			$dbConn = self::makeDbConn();
		}


        if ($table == 'user' || (! self::checkForTable($table, $dbConn))) {
            $table = self::addOrRemoveS($table);

            if (! self::checkForTable($table, $dbConn)) {
                throw new TableDoesNotExistException;
            }
        }

        return $table;
    }
public static function mapClassToTable ( $ className , $ dbConn = NULL ) { $ demarcation = strrpos ( $ className , '\\' , - 1 ) ; if ( $ demarcation !== false ) { $ table = strtolower ( substr ( $ className , $ demarcation + 1 ) ) ; } else { $ table = strtolower ( $ className ) ; } if ( is_null ( $ dbConn ) ) { $ dbConn = self :: makeDbConn ( ) ; } if ( $ table == 'user' || ( ! self :: checkForTable ( $ table , $ dbConn ) ) ) { $ table = self :: addOrRemoveS ( $ table ) ; if ( ! self :: checkForTable ( $ table , $ dbConn ) ) { throw new TableDoesNotExistException ; } } return $ table ; }
Map a class to a database table

@param string $className Name of a class to be mapped to a table in the database
@return string $table Database table successfully mapped to the class being used
Map a class to a database table