PHP Class Spot\Config

Inheritance: implements Serializable
Afficher le fichier Open project: vlucas/spot Class Usage Examples

Protected Properties

Свойство Type Description
$_connections
$_defaultConnection
$_typeHandlers

Méthodes publiques

Méthode Description
__construct ( )
addConnection ( string $name, string $dsn, array $options = [], $default = false ) : Spot_Adapter_Interface Add database connection
connection ( string $name = null ) : Spot_Adapter_Interface Get connection by name
defaultConnection ( ) : Spot_Adapter_Interface Get default connection
serialize ( ) Default serialization behavior is to not attempt to serialize stored adapter connections at all (thanks @TheSavior re: Issue #7)
typeHandler ( string $type, $class = null ) : Spot_Adapter_Interface Get type handler class by type
unserialize ( $serialized )

Method Details

__construct() public méthode

public __construct ( )

addConnection() public méthode

Add database connection
public addConnection ( string $name, string $dsn, array $options = [], $default = false ) : Spot_Adapter_Interface
$name string Unique name for the connection
$dsn string DSN string for this connection
$options array Array of key => value options for adapter
Résultat Spot_Adapter_Interface Spot adapter instance

connection() public méthode

Get connection by name
public connection ( string $name = null ) : Spot_Adapter_Interface
$name string Unique name of the connection to be returned
Résultat Spot_Adapter_Interface Spot adapter instance

defaultConnection() public méthode

Get default connection
public defaultConnection ( ) : Spot_Adapter_Interface
Résultat Spot_Adapter_Interface Spot adapter instance

serialize() public méthode

Default serialization behavior is to not attempt to serialize stored adapter connections at all (thanks @TheSavior re: Issue #7)
public serialize ( )

typeHandler() public static méthode

Get type handler class by type
public static typeHandler ( string $type, $class = null ) : Spot_Adapter_Interface
$type string Field type (i.e. 'string' or 'int', etc.)
Résultat Spot_Adapter_Interface Spot adapter instance

unserialize() public méthode

public unserialize ( $serialized )

Property Details

$_connections protected_oe property

protected $_connections

$_defaultConnection protected_oe property

protected $_defaultConnection

$_typeHandlers protected_oe static_oe property

protected static $_typeHandlers