Alter query once it is built in cakephp 4?

Hello everyone, I have a query that I create through logical checks in line of my code 100 and I was wondering if there is any way to “edit” my query down the line by “changing” one of it’s parameters and then reuse it once again?

Example below:

// line 100 of my code
$example_query = $this->model->find();

 $example_query->where(['field_spec' => VALUE_A]);

// I have my query object go through several logical checks.
//Eventually I execute my query
$data_A = $example_query->toArray();

// … Then many lines of code later I need to use the same query but with a parameter change:

$example_query->where(['field_spec' => VALUE_B]);
$data_B =  $example_query->toArray();

If someone could recommend something I would appreciate it!

The third parameter to the where function indicates whether to overwrite existing conditions.

You can also $for_later = clone($example_query);
clone query object before first condition.