Skip to content

Commit

Permalink
Update Query.php
Browse files Browse the repository at this point in the history
  • Loading branch information
accgit authored Aug 13, 2024
1 parent cb6394f commit 0d5b469
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Drago/Database/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ public function get(int $id): Fluent
* Deleting a records.
* @throws AttributeDetectionException
*/
public function remove(int|array ...$cond): Fluent
public function remove(int|string|array ...$cond): Fluent
{
$delete = $this->db->delete($this->getTableName());
if (is_int($cond)) $delete->where('%n = ?', $this->getPrimaryKey(), $cond); else {
$delete->where(...$cond);
}
$delete = $this->db->delete(
$this->getTableName(),
);
is_int($cond)
? $delete->where('%n = ?', $this->getPrimaryKey(), $cond)
: $delete->where(...$cond);
return $delete;
}

Expand Down

0 comments on commit 0d5b469

Please sign in to comment.