コード例 #1
0
 public function testIsManyToOne()
 {
     $this->assertFalse($this->doctrineMetadata->isManyToOne());
     $this->doctrineMetadata->set('type', ClassMetadataInfo::MANY_TO_ONE);
     $this->assertTrue($this->doctrineMetadata->isManyToOne());
 }
コード例 #2
0
 /**
  * Checks if association is inverse and related to one entity
  *
  * @param DoctrineMetadata $metadata
  * @return bool
  */
 protected function isAssociationTypeToOne(DoctrineMetadata $metadata)
 {
     return $metadata->isManyToOne() || $metadata->isOneToOne();
 }