private function addReferenceMapping(ClassMetadata $class, $reference, $type)
{
/** @var $class \Doctrine\ODM\PHPCR\Mapping\ClassMetadata */
$attributes = (array) $reference->attributes();
$mapping = $attributes["@attributes"];
$mapping['strategy'] = isset($mapping['strategy']) ? strtolower($mapping['strategy']) : null;
$mapping['targetDocument'] = isset($mapping['target-document']) ? $mapping['target-document'] : null;
unset($mapping['target-document']);
if ($type === 'many') {
$class->mapManyToMany($mapping);
} elseif ($type === 'one') {
$class->mapManyToOne($mapping);
}
}