lithium\data\source\database\adapter\PostgreSql::__construct PHP Method

__construct() public method

Constructor. Constructs the PostgreSQL adapter and sets the default port to 5432.
See also: lithium\data\source\Database::__construct()
See also: lithium\data\Source::__construct()
See also: lithium\data\Connections::add()
public __construct ( array $config = [] ) : void
$config array The available configuration options are the following. Further options are inherited from the parent classes. Typically, these parameters are set in `Connections::add()`, when adding the adapter to the list of active connections. - `'host'` _string_: Defaults to `'localhost:5432'`. - `'schema'` _string_: The name of the database schema to use. Defaults to `'public'`. - `'timezone'` _string_: The timezone to use. Defaults to `'null'`
return void
    public function __construct(array $config = array())
    {
        $defaults = array('host' => 'localhost:5432', 'schema' => 'public', 'timezone' => null);
        parent::__construct($config + $defaults);
    }

Usage Example

Beispiel #1
0
 public function __construct(array $config = array())
 {
     parent::__construct($config);
     $this->connection = $this;
 }