Exemplo n.º 1
0
 public function testHasDoctrineMetadata()
 {
     $metadata = new FieldMetadata($this->options);
     $this->assertFalse($metadata->hasDoctrineMetadata());
     $metadata->setDoctrineMetadata($this->doctrineMetadata);
     $this->assertTrue($metadata->hasDoctrineMetadata());
 }
 /**
  * Checks if this class supports accessing entity
  *
  * @param string        $entity
  * @param FieldMetadata $metadata
  * @return string
  */
 public function supports($entity, FieldMetadata $metadata)
 {
     return !$metadata->isDefinedBySourceEntity() && $metadata->hasDoctrineMetadata() && $this->isAssociationTypeToOne($metadata->getDoctrineMetadata());
 }