diff --git a/lib/Doctrine/Collection.php b/lib/Doctrine/Collection.php index 5ea30a391..8f1651c3f 100644 --- a/lib/Doctrine/Collection.php +++ b/lib/Doctrine/Collection.php @@ -158,7 +158,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator $this->_table = $connection->getTable($this->_table); if ($keyColumn === null) { - $keyColumn = $table->getBoundQueryPart('indexBy'); + $keyColumn = $this->_table->getBoundQueryPart('indexBy'); } if ($keyColumn !== null) {