Skip to content

Commit 7d1737f

Browse files
committed
First bug fixes.
1 parent d35434f commit 7d1737f

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/DataMapper/DataMapper.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ public function setParameters(array $parameters): self
9292
*/
9393
public function addParameter(string $key, $value): string
9494
{
95+
if($value === null){
96+
return 'NULL';
97+
}
9598
$originKey = ':' . \ltrim(\str_replace('.', '', $key), ':');
9699
$i = 0;
97100

src/QueryBuilder/Expressions/From.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ protected function endTableSchema(): ?string
5252
protected function fromQuery(): string
5353
{
5454
if(($schema = $this->db->getSchema()) !== null){
55-
\array_unshift($this->tables, $schema);
55+
if(!\in_array($schema, $this->tables, true)){
56+
\array_unshift($this->tables, $schema);
57+
}
5658
}
5759
return ' FROM ' . \implode(', ', $this->tables);
5860
}

0 commit comments

Comments
 (0)