Skip to content

Commit

Permalink
Respect aliased tables on cloning the gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Heber committed Oct 7, 2014
1 parent aa47cab commit 0d77c29
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions library/Zend/Db/TableGateway/AbstractTableGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,14 @@ public function __clone()
$this->sql = clone $this->sql;
if (is_object($this->table)) {
$this->table = clone $this->table;
} elseif (
is_array($this->table)
&& count($this->table) == 1
&& is_object(reset($this->table))
) {
foreach ($this->table as $alias => &$tableObject) {
$tableObject = clone $tableObject;
}
}
}

Expand Down

0 comments on commit 0d77c29

Please sign in to comment.