- Multiple bugfixe linked to query fragments

- Added a new SearchRequest package to handle search request efficiently
This commit is contained in:
Dave Mc Nicoll committed 2020-03-28 22:13:29 -04:00
1 parent 4b29232543
commit 938639a590
15 files changed
+148 -27

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@ class EntityField
# Must use REFLECTION before throwing this value.
# Should first check if it's a relation field, and if it is,
# it's real key must be returned (PK usually)
return $useAlias ? "{$this->alias}.\"{$this->name}\"" : "\"{$this->name}\"";
return $useAlias ? "{$this->alias}.`{$this->name}`" : "`{$this->name}`";
}
public static function isScalarType($type) : bool
+3 -6
View File
@@ -8,8 +8,6 @@ use PDO,
class PdoObject extends PDO {
public function select(string $sql, array $parameters = []): PDOStatement {
# var_dump($sql, $parameters); die();
try {
if (false !== ( $statement = $this->prepare($sql) )) {
$statement = $this->execute($statement, $parameters, false);
@@ -23,8 +21,6 @@ class PdoObject extends PDO {
}
public function runQuery(string $sql, array $parameters = []): ? PDOStatement {
# dump($sql, $parameters); return null;
try {
if (false !== ( $statement = $this->prepare($sql) )) {
return $this->execute($statement, $parameters, true);
@@ -50,8 +46,9 @@ class PdoObject extends PDO {
}
return $statement;
} else {
throw new PDOException('Could not begin transaction or given statement is invalid.');
}
else {
throw new \PDOException($statement->errorCode() . " - " . json_encode($statement->errorInfo()));
}
} catch (\PDOException $e) {
$this->rollback();