Merge branch 'master' of https://github.com/mcNdave/ulmus
This commit is contained in:
commit
f98cb2ded0
|
@ -39,7 +39,7 @@ class EntityResolver {
|
||||||
public function field($name, $fieldKey = self::KEY_ENTITY_NAME, $throwException = true) : ? array
|
public function field($name, $fieldKey = self::KEY_ENTITY_NAME, $throwException = true) : ? array
|
||||||
{
|
{
|
||||||
try{
|
try{
|
||||||
return $this->fieldList($fieldKey)[$name];
|
return $this->fieldList($fieldKey)[$name] ?? null;
|
||||||
}
|
}
|
||||||
catch(\Throwable $e) {
|
catch(\Throwable $e) {
|
||||||
if ( $throwException) {
|
if ( $throwException) {
|
||||||
|
|
|
@ -46,12 +46,13 @@ class PdoObject extends PDO {
|
||||||
}
|
}
|
||||||
|
|
||||||
return $statement;
|
return $statement;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new \PDOException($statement->errorCode() . " - " . json_encode($statement->errorInfo()));
|
throw new \PDOException($statement->errorCode() . " - " . json_encode($statement->errorInfo()));
|
||||||
}
|
}
|
||||||
} catch (\PDOException $e) {
|
} catch (\PDOException $e) {
|
||||||
$this->rollback();
|
$this->rollback();
|
||||||
|
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue