Skip to content

Commit

Permalink
correcao getinstance
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobmorais committed Apr 12, 2023
1 parent 567ff5c commit 5d893d6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/DatalayerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ trait DatalayerTrait
/** @var string */
private $logSQL;

public function __construct()
{
$this->getInstance();
}

/**
* @return PDO|null
*/
Expand All @@ -52,7 +57,7 @@ private function getInstance(): ?PDO
$this->database .= ucfirst(CONFIG_DATA_LAYER["homologation"]??"");
}

if (!isset($this->instance)) {
if (empty($this->instance)) {
$this->instance = Connect::getInstance($this->database);
}

Expand Down

0 comments on commit 5d893d6

Please sign in to comment.