Skip to content

Commit

Permalink
queryArgs() is silently deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Nov 24, 2021
1 parent d0f3e19 commit 0b3b2f5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Database/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ public function query(string $sql, ...$params): ResultSet
}


/** @deprecated use query() */
public function queryArgs(string $sql, array $params): ResultSet
{
return $this->query($sql, ...$params);
Expand Down
1 change: 1 addition & 0 deletions src/Database/Explorer.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function query(string $sql, ...$params): ResultSet
}


/** @deprecated use query() */
public function queryArgs(string $sql, array $params): ResultSet
{
return $this->connection->query($sql, ...$params);
Expand Down
8 changes: 4 additions & 4 deletions src/Database/Table/Selection.php
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ protected function createGroupedSelectionInstance(string $table, string $column)

protected function query(string $query): Nette\Database\ResultSet
{
return $this->explorer->queryArgs($query, $this->sqlBuilder->getParameters());
return $this->explorer->query($query, ...$this->sqlBuilder->getParameters());
}


Expand Down Expand Up @@ -802,7 +802,7 @@ public function insert(iterable $data)
$primaryAutoincrementKey = $this->explorer->getStructure()->getPrimaryAutoincrementKey($this->name);

if ($data instanceof self) {
$return = $this->explorer->queryArgs($this->sqlBuilder->buildInsertQuery() . ' ' . $data->getSql(), $data->getSqlBuilder()->getParameters());
$return = $this->explorer->query($this->sqlBuilder->buildInsertQuery() . ' ' . $data->getSql(), ...$data->getSqlBuilder()->getParameters());

} else {
if ($data instanceof \Traversable) {
Expand Down Expand Up @@ -888,9 +888,9 @@ public function update(iterable $data): int
return 0;
}

return $this->explorer->queryArgs(
return $this->explorer->query(
$this->sqlBuilder->buildUpdateQuery(),
array_merge([$data], $this->sqlBuilder->getParameters())
...array_merge([$data], $this->sqlBuilder->getParameters())
)->getRowCount();
}

Expand Down

0 comments on commit 0b3b2f5

Please sign in to comment.