protected function getIsView($schemaName, $tableName)
{
if ($this->getServerVersion() < 5.01) {
return false;
}
if ($schemaName !== null) {
$sql = "SHOW FULL TABLES FROM `{$schemaName}` LIKE :table";
} else {
$sql = "SHOW FULL TABLES LIKE :table";
}
$command = $this->getDbConnection()->createCommand($sql);
$command->bindValue(':table', $tableName);
try {
return count($result = $command->queryRow()) > 0 && $result['Table_type'] === 'VIEW';
} catch (TDbException $e) {
$table = $schemaName === null ? $tableName : $schemaName . '.' . $tableName;
throw new TDbException('dbcommon_invalid_table_name', $table, $e->getMessage());
}
}