Spot\Adapter\PDO\BaseAbstract::dropDatasource PHP Метод

dropDatasource() публичный Метод

Drop a database table Destructive and dangerous - drops entire table and all data
public dropDatasource ( $datasource )
    public function dropDatasource($datasource)
    {
        $sql = "DROP TABLE " . $datasource;
        // Add query to log
        \Spot\Log::addQuery($this, $sql);
        try {
            return $this->connection()->exec($sql);
        } catch (\PDOException $e) {
            // Table does not exist
            if ($e->getCode() == "42S02") {
                throw new \Spot\Exception_Datasource_Missing("Table or datasource '" . $datasource . "' does not exist");
            }
            // Re-throw exception
            throw $e;
        }
    }