src/Sp/FixtureDumper/Generator/AbstractGenerator.php
protected function processAssociationNames(ClassMetadata $metadata, $model)
    {
        $data = array();
        foreach ($metadata->getAssociationNames() as $assocName) {
            $propertyValue = $this->readProperty($model, $assocName);
            if (null === $propertyValue || $metadata->isAssociationInverseSide($assocName)) {
                continue;
            }

            if ($metadata->isSingleValuedAssociation($assocName)) {
                $assocValue = $this->namingStrategy->modelName($propertyValue, $this->getManager()->getClassMetadata(get_class($propertyValue)));
                $assocValue = $this->navigator->accept($this->getVisitor(), $assocValue, 'reference');
                $data[$assocName] = $assocValue;
            } else {
                $data[$assocName] = array();
                foreach ($propertyValue as $value) {
                    $assocValue = $this->namingStrategy->modelName($value, $this->getManager()->getClassMetadata(get_class($value)));
                    $assocValue = $this->navigator->accept($this->getVisitor(), $assocValue, 'reference');
                    $data[$assocName][] = $assocValue;
                }
            }
        }

        return $data;
    }
protected function processAssociationNames(ClassMetadata $metadata, $model)
    {
        $data = array();
        foreach ($metadata->getAssociationNames() as $assocName) {
            $propertyValue = $this->readProperty($model, $assocName);
            if (null === $propertyValue || $metadata->isAssociationInverseSide($assocName)) {
                continue;
            }

            if ($metadata->isSingleValuedAssociation($assocName)) {
                $assocValue = $this->namingStrategy->modelName($propertyValue, $this->getManager()->getClassMetadata(get_class($propertyValue)));
                $assocValue = $this->navigator->accept($this->getVisitor(), $assocValue, 'reference');
                $data[$assocName] = $assocValue;
            } else {
                $data[$assocName] = array();
                foreach ($propertyValue as $value) {
                    $assocValue = $this->namingStrategy->modelName($value, $this->getManager()->getClassMetadata(get_class($value)));
                    $assocValue = $this->navigator->accept($this->getVisitor(), $assocValue, 'reference');
                    $data[$assocName][] = $assocValue;
                }
            }
        }

        return $data;
    }
@param \Doctrine\Common\Persistence\Mapping\ClassMetadata $metadata
@param                                                    $model

@return array