Commit 3829072b authored by Laurent Lécluse's avatar Laurent Lécluse
Browse files

Amélioration de la gestion des NULL

parent b5849b5a
......@@ -181,7 +181,7 @@ class Table
*
* @return bool
*/
public function delete($where, array $options = []): bool
public function delete($where=null, array $options = []): bool
{
$params = [];
$sql = "DELETE FROM \"$this->name\"" . $this->makeWhere($where, $options, $params);
......@@ -391,7 +391,11 @@ class Table
{
if (!isset($this->transformCache[$transformer][$value])) {
$val = $this->getBdd()->select(sprintf($transformer, ':val'), ['val' => $value]);
$this->transformCache[$transformer][$value] = $this->sqlToVal(current($val[0]), $ddl);
if (isset($val[0])){
$this->transformCache[$transformer][$value] = $this->sqlToVal(current($val[0]), $ddl);
}else{
$this->transformCache[$transformer][$value] = null;
}
}
return $this->transformCache[$transformer][$value];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment