public function loadCollection(PersistentCollection $collection)
{
$assoc = $collection->getMapping();
switch ($assoc['type']) {
case ClassMetadata::ONE_TO_MANY:
$this->getEntityPersister($assoc['targetEntity'])->loadOneToManyCollection(
$assoc, $collection->getOwner(), $collection);
break;
case ClassMetadata::MANY_TO_MANY:
$this->getEntityPersister($assoc['targetEntity'])->loadManyToManyCollection(
$assoc, $collection->getOwner(), $collection);
break;
}
}