src/xPDO/xPDO.php
public function getTableName($className, $includeDb= false) {
        $table= null;
        if ($className= $this->loadClass($className)) {
            if (isset ($this->map[$className]['table'])) {
                $table= $this->map[$className]['table'];
                if (isset($this->map[$className]['package']) && isset($this->packages[$this->map[$className]['package']]['prefix'])) {
                    $table= $this->packages[$this->map[$className]['package']]['prefix'] . $table;
                } else {
                    $table= $this->getOption(xPDO::OPT_TABLE_PREFIX, null, '') . $table;
                }
            }
            if (!$table && $ancestry= $this->getAncestry($className, false)) {
                foreach ($ancestry as $ancestor) {
                    if (isset ($this->map[$ancestor]['table']) && $table= $this->map[$ancestor]['table']) {
                        if (isset($this->map[$ancestor]['package']) && isset($this->packages[$this->map[$ancestor]['package']]['prefix'])) {
                            $table= $this->packages[$this->map[$ancestor]['package']]['prefix'] . $table;
                        } else {
                            $table= $this->getOption(xPDO::OPT_TABLE_PREFIX, null, '') . $table;
                        }
                        break;
                    }
                }
            }
        }
        if ($table) {
            $table= $this->_getFullTableName($table, $includeDb);
            if ($this->getDebug() === true) $this->log(xPDO::LOG_LEVEL_DEBUG, 'Returning table name: ' . $table . ' for class: ' . $className);
        } else {
            $this->log(xPDO::LOG_LEVEL_ERROR, 'Could not get table name for class: ' . $className);
        }
        return $table;
    }
public function getTableName($className, $includeDb= false) {
        $table= null;
        if ($className= $this->loadClass($className)) {
            if (isset ($this->map[$className]['table'])) {
                $table= $this->map[$className]['table'];
                if (isset($this->map[$className]['package']) && isset($this->packages[$this->map[$className]['package']]['prefix'])) {
                    $table= $this->packages[$this->map[$className]['package']]['prefix'] . $table;
                } else {
                    $table= $this->getOption(xPDO::OPT_TABLE_PREFIX, null, '') . $table;
                }
            }
            if (!$table && $ancestry= $this->getAncestry($className, false)) {
                foreach ($ancestry as $ancestor) {
                    if (isset ($this->map[$ancestor]['table']) && $table= $this->map[$ancestor]['table']) {
                        if (isset($this->map[$ancestor]['package']) && isset($this->packages[$this->map[$ancestor]['package']]['prefix'])) {
                            $table= $this->packages[$this->map[$ancestor]['package']]['prefix'] . $table;
                        } else {
                            $table= $this->getOption(xPDO::OPT_TABLE_PREFIX, null, '') . $table;
                        }
                        break;
                    }
                }
            }
        }
        if ($table) {
            $table= $this->_getFullTableName($table, $includeDb);
            if ($this->getDebug() === true) $this->log(xPDO::LOG_LEVEL_DEBUG, 'Returning table name: ' . $table . ' for class: ' . $className);
        } else {
            $this->log(xPDO::LOG_LEVEL_ERROR, 'Could not get table name for class: ' . $className);
        }
        return $table;
    }
public function getTableName ( $ className , $ includeDb = false ) { $ table = null ; if ( $ className = $ this -> loadClass ( $ className ) ) { if ( isset ( $ this -> map [ $ className ] [ 'table' ] ) ) { $ table = $ this -> map [ $ className ] [ 'table' ] ; if ( isset ( $ this -> map [ $ className ] [ 'package' ] ) && isset ( $ this -> packages [ $ this -> map [ $ className ] [ 'package' ] ] [ 'prefix' ] ) ) { $ table = $ this -> packages [ $ this -> map [ $ className ] [ 'package' ] ] [ 'prefix' ] . $ table ; } else { $ table = $ this -> getOption ( xPDO :: OPT_TABLE_PREFIX , null , '' ) . $ table ; } } if ( ! $ table && $ ancestry = $ this -> getAncestry ( $ className , false ) ) { foreach ( $ ancestry as $ ancestor ) { if ( isset ( $ this -> map [ $ ancestor ] [ 'table' ] ) && $ table = $ this -> map [ $ ancestor ] [ 'table' ] ) { if ( isset ( $ this -> map [ $ ancestor ] [ 'package' ] ) && isset ( $ this -> packages [ $ this -> map [ $ ancestor ] [ 'package' ] ] [ 'prefix' ] ) ) { $ table = $ this -> packages [ $ this -> map [ $ ancestor ] [ 'package' ] ] [ 'prefix' ] . $ table ; } else { $ table = $ this -> getOption ( xPDO :: OPT_TABLE_PREFIX , null , '' ) . $ table ; } break ; } } } } if ( $ table ) { $ table = $ this -> _getFullTableName ( $ table , $ includeDb ) ; if ( $ this -> getDebug ( ) === true ) $ this -> log ( xPDO :: LOG_LEVEL_DEBUG , 'Returning table name: ' . $ table . ' for class: ' . $ className ) ; } else { $ this -> log ( xPDO :: LOG_LEVEL_ERROR , 'Could not get table name for class: ' . $ className ) ; } return $ table ; }
Gets the actual run-time table name from a specified class name.

@param string $className The name of the class to lookup a table name
for.
@param boolean $includeDb Qualify the table name with the database name.
@return string The table name for the class, or null if unsuccessful.
Gets the actual run - time table name from a specified class name .