/** * Connect into your DataBase * */ public function connect(abstractConnectorConfig $connectorConfig) { if (!$this->isConnected()) { try { $this->instance = new PDO($connectorConfig->getDsn(), $connectorConfig->getUser(), $connectorConfig->getPassword()); } catch (PDOException $e) { throw new Exception("Error to connect on your database." . $e->getMessage()); } $this->instance->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } }