- Added some new method to EntityCollection (replaceWith, mergeWith, randomize, sort)
- WIP on virtual fields - Some minor bugfixes
This commit is contained in:
1 parent
c8397484e6
commit
30a0a80cbe
9 files changed
+213
-47
No files matched your search
@@ -6,9 +6,13 @@ use PDO,
|
||||
PDOStatement;
|
||||
|
||||
class PdoObject extends PDO {
|
||||
|
||||
public static ? string $dump = null;
|
||||
|
||||
public function select(string $sql, array $parameters = []): PDOStatement
|
||||
{
|
||||
static::$dump && call_user_func_array(static::$dump, [ $sql, $parameters ]);
|
||||
|
||||
try {
|
||||
if (false !== ( $statement = $this->prepare($sql) )) {
|
||||
$statement = $this->execute($statement, $parameters, false);
|
||||
@@ -24,6 +28,8 @@ class PdoObject extends PDO {
|
||||
|
||||
public function runQuery(string $sql, array $parameters = []): ? PDOStatement
|
||||
{
|
||||
static::$dump && call_user_func_array(static::$dump, [ $sql, $parameters ]);
|
||||
|
||||
try {
|
||||
if (false !== ( $statement = $this->prepare($sql) )) {
|
||||
return $this->execute($statement, $parameters, true);
|
||||
@@ -62,7 +68,9 @@ class PdoObject extends PDO {
|
||||
throw $e;
|
||||
}
|
||||
catch (\Throwable $e) {
|
||||
debogueur($statement, $parameters, $commit);
|
||||
if ( function_exists("debogueur") ) {
|
||||
debogueur($statement, $parameters, $commit);
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user