| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- class Core_Pdo {
- private $pdo;
- public function __construct(PDO $pdo) {
- $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
- $this->pdo = $pdo;
- }
- public function getPDO() {
- return $this->pdo;
- }
- //public PDOStatement PDO::prepare ( string $statement [, array $driver_options = array() ] )
- public function prepare($statement, $driver_options = array()) {
- return $this->pdo->prepare($statement, $driver_options);
- }
- // public PDOStatement query ( string $statement )
- public function query($statement) {
- return $this->pdo->query($statement);
- }
- // public string lastInsertId ([ string $name = NULL ] )
- public function lastInsertId() {
- return $this->pdo->lastInsertId();
- }
- // public int exec ( string $statement )
- public function exec($statement) {
- return $this->pdo->exec($statement);
- }
- // public string quote ( string $string [, int $parameter_type = PDO::PARAM_STR ] )
- public function quote($string, $parameter_type = PDO::PARAM_STR) {
- return $this->pdo->quote($string, $parameter_type);
- }
- }
|