Prado\Data\ActiveRecord\TActiveRecordGateway::getTableInfo PHP Method

getTableInfo() public method

Returns table information for table in the database connection.
public getTableInfo ( TDbConnection $connection, $tableName ) : TDbTableInfo
$connection Prado\Data\TDbConnection
return TDbTableInfo table details.
    public function getTableInfo(TDbConnection $connection, $tableName)
    {
        $connStr = $connection->getConnectionString();
        $key = $connStr . $tableName;
        if (!isset($this->_tables[$key])) {
            //call this first to ensure that unserializing the cache
            //will find the correct driver dependent classes.
            if (!isset($this->_meta[$connStr])) {
                $this->_meta[$connStr] = TDbMetaData::getInstance($connection);
            }
            $tableInfo = null;
            if (($cache = $this->getManager()->getCache()) !== null) {
                $tableInfo = $cache->get($key);
            }
            if (empty($tableInfo)) {
                $tableInfo = $this->_meta[$connStr]->getTableInfo($tableName);
                if ($cache !== null) {
                    $cache->set($key, $tableInfo);
                }
            }
            $this->_tables[$key] = $tableInfo;
        }
        return $this->_tables[$key];
    }