- A lot of small bugfixes done on this version

This commit is contained in:
Dave Mc Nicoll committed 2022-04-13 03:30:50 +00:00
1 parent b681f245c0
commit 4d20cd50cc
10 files changed
+189 -33

No files matched your search

+25 -3
View File
@@ -43,6 +43,25 @@ class QueryBuilder implements Ulmus\Query\QueryBuilderInterface
return $this;
}
public function insert(array $dataset) : self
{
if ( null === $this->getFragment(Query\Insert::class) ) {
$insert = new Query\Insert();
$this->push($insert);
}
$insert->set($dataset);
return $this;
}
public function values(array $dataset) : self
{
$this->addValues(array_values($dataset));
return $this;
}
public function set(array $dataset, ? array $escapedFields = null) : self
{
if ( null === ( $set = $this->getFragment(Query\Set::class) ) ) {
@@ -72,12 +91,15 @@ class QueryBuilder implements Ulmus\Query\QueryBuilderInterface
return $this;
}
public function delete() : self
public function delete(string $dn) : self
{
if ( ! $this->getFragment(Ulmus\Query\Delete::class) ) {
$this->push(new Ulmus\Query\Delete());
if ( null === ( $delete = $this->getFragment(Query\Delete::class) ) ) {
$delete = new Query\Delete($this);
$this->push($delete);
}
$delete->dn = $dn;
return $this;
}