2017 © Pedro Peláez
 

library extended-pdo

An extension on the standard PDO library.

image

tomwright/extended-pdo

An extension on the standard PDO library.

  • Tuesday, November 21, 2017
  • by TomWright
  • Repository
  • 1 Watchers
  • 0 Stars
  • 545 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 14 Versions
  • 3 % Grown

The README.md

Extended PDO

Build Status Latest Stable Version Total Downloads Monthly Downloads Daily Downloads License, (*1)

Installation

composer install tomwright/extended-pdo

Connecting

ExtendedPDO implements the singleton design pattern using tomwright/singleton. For more information on how the following code works, see the documentation., (*2)

$db = ExtendedPDO::createConnection($dsn, $username, $password, 'my-main-db');
$db2 = ExtendedPDO::getInstance('my-main-db');

var_dump($db === $db2) // TRUE

Usage

// Returns an array of records
$db->queryAll('SELECT * FROM users WHERE username = :username', [':username' => 'Tom']);

// Returns the first record
$db->queryRow('SELECT * FROM users WHERE username = :username LIMIT 1', [':username' => 'Tom']);

Query Return Types

You can set the return type of the dbQuery(), queryAll() and queryRow() methods using $db->setReturnType($x) where $x is the return type you'd like to use., (*3)

Available return types are as follows:, (*4)

  • ExtendedPDO::RETURN_TYPE_OBJECT - Your results will be returned as objects
  • ExtendedPDO::RETURN_TYPE_ASSOC - Your results will be returned as associative arrays
  • ExtendedPDO::RETURN_TYPE_STMT - The statement object will be returned directly

You can also set a return type of \PDO::FETCH_ASSOC for example and it will override any of the above. This makes all of the standard PDO fetch types usable., (*5)

Query Builder

ExtendedPDO also comes with it's own Query Builder., (*6)

The Versions

21/11 2017

dev-master

9999999-dev

An extension on the standard PDO library.

  Sources   Download

The Requires

 

22/05 2017

1.0.2

1.0.2.0

An extension on the standard PDO library.

  Sources   Download

The Requires

 

27/03 2017

1.0.1

1.0.1.0

An extension on the standard PDO library.

  Sources   Download

The Requires

 

24/03 2017

1.0.0

1.0.0.0

An extension on the standard PDO library.

  Sources   Download

The Requires

 

17/02 2017

0.0.10

0.0.10.0

An extension on the standard PDO library.

  Sources   Download

The Requires

 

17/02 2017

0.0.9

0.0.9.0

An extension on the standard PDO library.

  Sources   Download

The Requires

 

17/02 2017

0.0.8

0.0.8.0

An extension on the standard PDO library.

  Sources   Download

The Requires

 

09/02 2017

0.0.7

0.0.7.0

An extension on the standard PDO library.

  Sources   Download

The Requires

 

01/02 2017

0.0.6

0.0.6.0

An extension on the standard PDO library.

  Sources   Download

The Requires

 

01/12 2016

0.0.5

0.0.5.0

An extension on the standard PDO library.

  Sources   Download

The Requires

 

29/11 2016

0.0.4

0.0.4.0

An extension on the standard PDO library.

  Sources   Download

The Requires

 

15/11 2016

0.0.3

0.0.3.0

An extension on the standard PDO library.

  Sources   Download

The Requires

 

14/11 2016

0.0.2

0.0.2.0

An extension on the standard PDO library.

  Sources   Download

The Requires

 

10/11 2016

0.0.1

0.0.1.0

An extension on the standard PDO library.

  Sources   Download

The Requires