Skip to content

Commit

Permalink
Expose the query parameters in delete queries
Browse files Browse the repository at this point in the history
  • Loading branch information
PeeHaa committed Apr 18, 2019
1 parent dedf166 commit 4d625d1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/QueryBuilder/Statement/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,24 @@ public function getQuery(): string

return 'DELETE FROM ' . $this->table->toSql() . $joins . $condition . $orders . $limit . $offset;
}

/**
* @return mixed[]
*/
public function getParameters(): array
{
$parameters = [];

if ($this->condition !== null) {
$parameters = array_merge($parameters, $this->condition->getParameters());
}

if ($this->joins) {
foreach ($this->joins as $join) {
$parameters = array_merge($parameters, $join->getParameters());
}
}

return $parameters;
}
}

0 comments on commit 4d625d1

Please sign in to comment.