diff --git a/src/Addiks/PHPSQL/PDO/Statement.php b/src/Addiks/PHPSQL/PDO/Statement.php index cdf9b16..c44dfc6 100644 --- a/src/Addiks/PHPSQL/PDO/Statement.php +++ b/src/Addiks/PHPSQL/PDO/Statement.php @@ -426,7 +426,7 @@ public function fetchAll($fetchStyle = \PDO::FETCH_BOTH) public function fetchColumn($columnIndex = 0) { - $row = $this->fetch(Code::FETCH_NUM); + $row = $this->fetch(\PDO::FETCH_NUM); return $row[(int)$columnIndex]; } diff --git a/src/Addiks/PHPSQL/Table/TableManager.php b/src/Addiks/PHPSQL/Table/TableManager.php index c30b97e..5fa83ab 100644 --- a/src/Addiks/PHPSQL/Table/TableManager.php +++ b/src/Addiks/PHPSQL/Table/TableManager.php @@ -29,6 +29,7 @@ use Addiks\PHPSQL\Table\TableFactoryInterface; use Addiks\PHPSQL\Column\ColumnDataFactoryInterface; use Addiks\PHPSQL\Index\IndexFactory; +use InvalidArgumentException; class TableManager { @@ -73,6 +74,10 @@ public function getTable($tableName, $schemaId = null) $tableIndex = $databaseSchema->getTableIndex($tableName); + if (is_null($tableIndex)) { + throw new InvalidArgumentException("Table '{$tableName}' does not exist!"); + } + /* @var $databaseSchemaPage DatabaseSchemaPage */ $databaseSchemaPage = $databaseSchema->getTablePage($tableIndex, $schemaId);