Example #1
0
 /**
  * @param ClassMetadata      $metadata
  * @param ReflectionProperty $property
  * @param ConfigAnnotation   $annotation
  */
 public function build(ClassMetadata $metadata, ReflectionProperty $property, ConfigAnnotation $annotation)
 {
     $builder = new ManyToManyAssociationBuilder(new ClassMetadataBuilder($metadata), ['fieldName' => $property->getName(), 'targetEntity' => $annotation->getTargetEntity($this->config)], ClassMetadata::MANY_TO_MANY);
     if (isset($annotation->inversedBy) && $annotation->inversedBy) {
         $builder->inversedBy($annotation->inversedBy);
     }
     if (isset($annotation->mappedBy) && $annotation->mappedBy) {
         $builder->mappedBy($annotation->mappedBy);
     }
     $builder->build();
 }