Skip to content

Commit af79ff5

Browse files
committed
small fixes
1 parent 8cf2880 commit af79ff5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Addiks/PHPSQL/PDO/Statement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ public function fetchAll($fetchStyle = \PDO::FETCH_BOTH)
426426
public function fetchColumn($columnIndex = 0)
427427
{
428428

429-
$row = $this->fetch(Code::FETCH_NUM);
429+
$row = $this->fetch(\PDO::FETCH_NUM);
430430

431431
return $row[(int)$columnIndex];
432432
}

src/Addiks/PHPSQL/Table/TableManager.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
use Addiks\PHPSQL\Table\TableFactoryInterface;
3030
use Addiks\PHPSQL\Column\ColumnDataFactoryInterface;
3131
use Addiks\PHPSQL\Index\IndexFactory;
32+
use InvalidArgumentException;
3233

3334
class TableManager
3435
{
@@ -73,6 +74,10 @@ public function getTable($tableName, $schemaId = null)
7374

7475
$tableIndex = $databaseSchema->getTableIndex($tableName);
7576

77+
if (is_null($tableIndex)) {
78+
throw new InvalidArgumentException("Table '{$tableName}' does not exist!");
79+
}
80+
7681
/* @var $databaseSchemaPage DatabaseSchemaPage */
7782
$databaseSchemaPage = $databaseSchema->getTablePage($tableIndex, $schemaId);
7883

0 commit comments

Comments
 (0)