PHP Class Pop\Db\Db

Author: Nick Sagona, III ([email protected])
Show file Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Property Type Description
$adapter mixed Default database adapter object
$isPdo boolean Flag for a PDO adapter

Public Methods

Method Description
__construct ( string $type, array $options, string $prefix = 'Pop\Db\Adapter\' ) : Db Constructor
adapter ( ) : mixed Get the database adapter.
factory ( string $type, array $options, string $prefix = 'Pop\Db\Adapter\' ) : Db Determine whether or not an instance of the DB object exists already, and instantiate the object if it doesn't exist.
getAdapterType ( ) : string Get the database adapter type.
isPdo ( ) : boolean Get the PDO flag

Method Details

__construct() public method

Instantiate the database connection object.
public __construct ( string $type, array $options, string $prefix = 'Pop\Db\Adapter\' ) : Db
$type string
$options array
$prefix string
return Db

adapter() public method

Get the database adapter.
public adapter ( ) : mixed
return mixed

factory() public static method

Determine whether or not an instance of the DB object exists already, and instantiate the object if it doesn't exist.
public static factory ( string $type, array $options, string $prefix = 'Pop\Db\Adapter\' ) : Db
$type string
$options array
$prefix string
return Db

getAdapterType() public method

Get the database adapter type.
public getAdapterType ( ) : string
return string

isPdo() public method

Get the PDO flag
public isPdo ( ) : boolean
return boolean

Property Details

$adapter protected property

Default database adapter object
protected mixed $adapter
return mixed

$isPdo protected property

Flag for a PDO adapter
protected bool $isPdo
return boolean