1
0
mirror of synced 2025-02-07 15:59:27 +03:00

array was not initalized

This commit is contained in:
runa 2007-02-07 16:31:28 +00:00
parent dc73de10b3
commit 2e6e9d6df8

View File

@ -596,6 +596,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
*/ */
public function loadRelated($name = null) public function loadRelated($name = null)
{ {
$list = array();
$query = new Doctrine_Query($this->table->getConnection()); $query = new Doctrine_Query($this->table->getConnection());
if ( ! isset($name)) { if ( ! isset($name)) {
@ -616,7 +617,6 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
$foreign = $rel->getForeign(); $foreign = $rel->getForeign();
$local = $rel->getLocal(); $local = $rel->getLocal();
$list = array();
if ($rel instanceof Doctrine_Relation_LocalKey || $rel instanceof Doctrine_Relation_ForeignKey) { if ($rel instanceof Doctrine_Relation_LocalKey || $rel instanceof Doctrine_Relation_ForeignKey) {
foreach ($this->data as $record) { foreach ($this->data as $record) {
$list[] = $record[$local]; $list[] = $record[$local];