Overview

Namespaces

  • Ark
    • Database

Classes

  • Connection
  • Model
  • ModelFactory
  • QueryBuilder

Interfaces

  • Exception
  • Overview
  • Namespace
  • Class

Class Connection

Database connection management

Namespace: Ark\Database
Located at Connection.php
Methods summary
public
# __construct( string $dsn = null, string $username = null, string $password = null, array $options = array() )

Constructor

Constructor

Parameters

$dsn
Database DSN
$username
$password
$options
public boolean
# isAutoSlave( )

Is connection manager in auto slave mode: it has auto_slave config, and connection is in automatic mode

Is connection manager in auto slave mode: it has auto_slave config, and connection is in automatic mode

Returns

boolean
public array
# getConfig( string $name = null )

Get connection config by name

Get connection config by name

Parameters

$name
Connection name

Returns

array
public PDO
# getPDO( string $name = null )

Get PDO instance

Get PDO instance

Parameters

$name
Connection name

Returns

PDO
public Ark\Database\Connection
# addConnection( string $name, string $dsn, string $username = null, string $password = null, array $options = [] )

Add a new connection configuration

Add a new connection configuration

Parameters

$name
$dsn
$username
$password
$options

Returns

Ark\Database\Connection
public Ark\Database\Connection
# switchConnection( string $name = null )

Switch connection

Switch connection

Parameters

$name

Returns

Ark\Database\Connection
public Ark\Database\ModelFactory
# factory( string $model )

Create a model factory

Create a model factory

Parameters

$model

Returns

Ark\Database\ModelFactory
public Ark\Database\QueryBuilder
# builder( )

Create query builder

Create query builder

Returns

Ark\Database\QueryBuilder
public
# getAttribute( $attribute )

Link

http://www.php.net/manual/en/pdo.getattribute.php
public
# setAttribute( $attribute, $value )

Link

http://www.php.net/manual/en/pdo.setattribute.php
public
# prepare( )

Link

http://www.php.net/manual/en/pdo.prepare.php
public
# query( )

Link

http://www.php.net/manual/en/pdo.query.php
public
# exec( )

Link

http://www.php.net/manual/en/pdo.exec.php
public
# beginTransaction( )

Link

http://www.php.net/manual/en/pdo.begintransaction.php
public
# rollBack( )

Link

http://www.php.net/manual/en/pdo.rollback.php
public
# commit( )

Link

http://www.php.net/manual/en/pdo.commit.php
public
# inTransaction( )

Link

http://www.php.net/manual/en/pdo.intransaction.php
public
# lastInsertId( )

Link

http://www.php.net/manual/en/pdo.lastinsertid.php
public
# quote( )

Link

http://www.php.net/manual/en/pdo.quote.php
public
# errorCode( )
public
# errorInfo( )
public string
# quoteTable( string $name )

Quote table name

Quote table name

Parameters

$name

Returns

string
public string
# quoteColumn( string $name )

Quote column name

Quote column name

Parameters

$name

Returns

string
public string
# quoteIdentifier( string $name )

Quote table or column

Quote table or column

Parameters

$name

Returns

string
public
# buildLimitOffset( $sql, $limit, $offset = 0 )
public
# getPrefix( )
public
# fixPrefix( $sql )
Properties summary
protected string $current

Current connection, null means select automatically, default means the default connection

Current connection, null means select automatically, default means the default connection

# null
protected array $connections
# []
protected array $configs
# []
API documentation generated by ApiGen