From b5f8ff5d6dceb40bd2036ba5f05cda78b3cf857f Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Thu, 16 Jan 2025 14:50:58 +0100 Subject: [PATCH] feat: add protected array property for where statement columns --- src/MySQL.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/MySQL.php b/src/MySQL.php index 3367d21..8fe9ef8 100644 --- a/src/MySQL.php +++ b/src/MySQL.php @@ -19,6 +19,7 @@ protected string $table; protected ?string $limit = null; protected ?string $order_by = null; + protected array $filter_columns = []; protected array $filter_values = []; protected ?string $filter_sql = null; @@ -74,6 +75,7 @@ // Unset filters if null was passed if ($conditions === null) { $this->filter_sql = null; + $this->filter_columns = null; $this->filter_values = null; return $this; @@ -93,6 +95,8 @@ // Create SQL string and append values to array for prepared statement foreach ($condition as $col => $operation) { + $this->filter_columns[] = $col; + // Assume we want an equals comparison if value is not an array if (!is_array($operation)) { $operation = [Operators::EQUALS->value => $operation];