From be3adfb35ebb0c4139f8ee4cae7b88ff8c9cd5c9 Mon Sep 17 00:00:00 2001 From: Asmir Mustafic Date: Wed, 19 Oct 2011 09:25:40 +0200 Subject: [PATCH] With TO_MANY relations, class filed is instanceof ArrayCollection, instead of targetEntity class type. --- lib/Doctrine/ORM/Tools/EntityGenerator.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index f130908e7..a3a27892c 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -806,7 +806,12 @@ public function () { $lines = array(); $lines[] = $this->_spaces . '/**'; - $lines[] = $this->_spaces . ' * @var ' . $associationMapping['targetEntity']; + + if ($associationMapping['type'] & ClassMetadataInfo::TO_MANY) { + $lines[] = $this->_spaces . ' * @var \Doctrine\Common\Collections\ArrayCollection'; + }else{ + $lines[] = $this->_spaces . ' * @var ' . $associationMapping['targetEntity']; + } if ($this->_generateAnnotations) { $lines[] = $this->_spaces . ' *';