-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
803a330
commit 33397c1
Showing
2 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
interface Environment | ||
{ | ||
public const PROJECT_NAME = 'My Database Packages by HungNG'; | ||
public const VERSION = '4.0.1'; | ||
public const VERSION = '4.0.2'; | ||
public const LAST_MODIFIED = '2024-04-02'; | ||
public const AUTHOR_NAME = 'Hung Nguyen'; | ||
public const AUTHOR_EMAIL = '[email protected]'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -506,6 +506,69 @@ public function getSelectRaw(): ?bool | |
return $this->selectRaw; | ||
} | ||
|
||
/** | ||
* Function startTransaction | ||
* | ||
* User: 713uk13m <[email protected]> | ||
* Copyright: 713uk13m <[email protected]> | ||
* @return void|null | ||
* @throws \Throwable | ||
*/ | ||
public function startTransaction() | ||
{ | ||
try { | ||
$connection = $this->db->getConnection($this->dbName); | ||
$connection->beginTransaction(); | ||
} catch (Exception $e) { | ||
$this->logger->error(__FUNCTION__, 'Error Message: ' . $e->getMessage()); | ||
$this->logger->error(__FUNCTION__, 'Error Trace As String: ' . $e->getTraceAsString()); | ||
|
||
return null; | ||
} | ||
} | ||
|
||
/** | ||
* Function transactionCommit | ||
* | ||
* User: 713uk13m <[email protected]> | ||
* Copyright: 713uk13m <[email protected]> | ||
* @return void|null | ||
* @throws \Throwable | ||
*/ | ||
public function transactionCommit() | ||
{ | ||
try { | ||
$connection = $this->db->getConnection($this->dbName); | ||
$connection->commit(); | ||
} catch (Exception $e) { | ||
$this->logger->error(__FUNCTION__, 'Error Message: ' . $e->getMessage()); | ||
$this->logger->error(__FUNCTION__, 'Error Trace As String: ' . $e->getTraceAsString()); | ||
|
||
return null; | ||
} | ||
} | ||
|
||
/** | ||
* Function transactionRollBack | ||
* | ||
* User: 713uk13m <[email protected]> | ||
* Copyright: 713uk13m <[email protected]> | ||
* @return void|null | ||
* @throws \Throwable | ||
*/ | ||
public function transactionRollBack() | ||
{ | ||
try { | ||
$connection = $this->db->getConnection($this->dbName); | ||
$connection->rollBack(); | ||
} catch (Exception $e) { | ||
$this->logger->error(__FUNCTION__, 'Error Message: ' . $e->getMessage()); | ||
$this->logger->error(__FUNCTION__, 'Error Trace As String: ' . $e->getTraceAsString()); | ||
|
||
return null; | ||
} | ||
} | ||
|
||
/*************************** DATABASE METHOD ***************************/ | ||
|
||
/** | ||
|