lithium\data\source\database\adapter\MySql::__construct PHP Méthode

__construct() public méthode

Constructor. Constructs the MySQL adapter and sets the default port to 3306.
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:3306'`.
Résultat void
    public function __construct(array $config = array())
    {
        $defaults = array('host' => 'localhost:3306');
        parent::__construct($config + $defaults);
    }

Usage Example

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