This repository has been archived on 2025-02-26. You can view files and clone it, but cannot push or open issues or pull requests.
szurubooru/src/PDOEx/PDOEx.php
Marcin Kurczewski c52ed6a455 Abandoned FPDO
Also, fixed tag search by categories
2014-10-19 20:09:06 +02:00

45 lines
758 B
PHP

<?php
namespace Szurubooru\PDOEx;
class PDOEx extends \PDO
{
private $queryCount = 0;
private $statements = [];
public function prepare($statement, $driverOptions = [])
{
++ $this->queryCount;
$this->statements[] = $statement;
return parent::prepare($statement, $driverOptions);
}
public function getQueryCount()
{
return $this->queryCount;
}
public function getStatements()
{
return $this->statements;
}
public function from($table)
{
return new SelectQuery($this, $table);
}
public function insertInto($table)
{
return new InsertQuery($this, $table);
}
public function update($table)
{
return new UpdateQuery($this, $table);
}
public function deleteFrom($table)
{
return new DeleteQuery($this, $table);
}
}