private function connect()
    {
        if (!$this->isConnected) {
            parent::__construct(
                $this->dsn,
                $this->server->getUsername(),
                $this->server->getPassword(),
                $this->driverOptions
            );
            parent::setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
            parent::setAttribute(
                PDO::ATTR_STATEMENT_CLASS,
                [__NAMESPACE__ . '\\' . self::PDO_STATEMENT_CLASS, [$this]]
            );

            $this->isConnected = true;
        }
    }
private function connect()
    {
        if (!$this->isConnected) {
            parent::__construct(
                $this->dsn,
                $this->server->getUsername(),
                $this->server->getPassword(),
                $this->driverOptions
            );
            parent::setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
            parent::setAttribute(
                PDO::ATTR_STATEMENT_CLASS,
                [__NAMESPACE__ . '\\' . self::PDO_STATEMENT_CLASS, [$this]]
            );

            $this->isConnected = true;
        }
    }
private function connect ( ) { if ( ! $ this -> isConnected ) { parent :: __construct ( $ this -> dsn , $ this -> server -> getUsername ( ) , $ this -> server -> getPassword ( ) , $ this -> driverOptions ) ; parent :: setAttribute ( PDO :: ATTR_ERRMODE , PDO :: ERRMODE_EXCEPTION ) ; parent :: setAttribute ( PDO :: ATTR_STATEMENT_CLASS , [ __NAMESPACE__ . '\\' . self :: PDO_STATEMENT_CLASS , [ $ this ] ] ) ; $ this -> isConnected = true ; } }
Attempts to connect to the server, which is done via lazy-connecting

@throws PDOException Thrown if there was an error connecting to the database
Attempts to connect to the server which is done via lazy - connecting