I would like to start with a base query and try first one where clause, and
if that fails, another. However, it seems that when changing what I think is
a copy of the select(), it changes both the copy and the original.
First I use:

$baseSelect = $this->select()
    ->from($this, array())
    ->columns(...
[bunches of things, including joins, three wheres, and an order]

At this point, an examination of $baseSelect shows everything as I expect
it. So I use:

$firstSelect = $baseSelect;

At this point, I'd expect both variables to be the same, and they are.

What I don't expect is that further changes to $firstSelect also update
$baseSelect, but that's what happens.

How can I create a *copy* of $baseSelect, so that if $firstSelect fails, I
don't have to build the entire select() again to get rid of the last where
clause?


ZF 1.9.0, PHP 5.2.6

-- Phillip Winn -- http://blogcritics.org/ -- 214/402-9466 --

Reply via email to