Merge branch 'DDC-2423'
This commit is contained in:
commit
abe8ef6778
@ -1274,6 +1274,15 @@ public function __construct()
|
|||||||
$typeOptions[] = 'orphanRemoval=' . ($associationMapping['orphanRemoval'] ? 'true' : 'false');
|
$typeOptions[] = 'orphanRemoval=' . ($associationMapping['orphanRemoval'] ? 'true' : 'false');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($associationMapping['fetch']) && $associationMapping['fetch'] !== ClassMetadataInfo::FETCH_LAZY) {
|
||||||
|
$fetchMap = array(
|
||||||
|
ClassMetadataInfo::FETCH_EXTRA_LAZY => 'EXTRA_LAZY',
|
||||||
|
ClassMetadataInfo::FETCH_EAGER => 'EAGER',
|
||||||
|
);
|
||||||
|
|
||||||
|
$typeOptions[] = 'fetch="' . $fetchMap[$associationMapping['fetch']] . '"';
|
||||||
|
}
|
||||||
|
|
||||||
$lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . '' . $type . '(' . implode(', ', $typeOptions) . ')';
|
$lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . '' . $type . '(' . implode(', ', $typeOptions) . ')';
|
||||||
|
|
||||||
if (isset($associationMapping['joinColumns']) && $associationMapping['joinColumns']) {
|
if (isset($associationMapping['joinColumns']) && $associationMapping['joinColumns']) {
|
||||||
|
@ -64,6 +64,7 @@ class EntityGeneratorTest extends \Doctrine\Tests\OrmTestCase
|
|||||||
$metadata->mapManyToMany(array(
|
$metadata->mapManyToMany(array(
|
||||||
'fieldName' => 'comments',
|
'fieldName' => 'comments',
|
||||||
'targetEntity' => 'Doctrine\Tests\ORM\Tools\EntityGeneratorComment',
|
'targetEntity' => 'Doctrine\Tests\ORM\Tools\EntityGeneratorComment',
|
||||||
|
'fetch' => ClassMetadataInfo::FETCH_EXTRA_LAZY,
|
||||||
'joinTable' => array(
|
'joinTable' => array(
|
||||||
'name' => 'book_comment',
|
'name' => 'book_comment',
|
||||||
'joinColumns' => array(array('name' => 'book_id', 'referencedColumnName' => 'id')),
|
'joinColumns' => array(array('name' => 'book_id', 'referencedColumnName' => 'id')),
|
||||||
@ -223,6 +224,8 @@ class EntityGeneratorTest extends \Doctrine\Tests\OrmTestCase
|
|||||||
$this->assertEquals($cm->identifier, $metadata->identifier);
|
$this->assertEquals($cm->identifier, $metadata->identifier);
|
||||||
$this->assertEquals($cm->idGenerator, $metadata->idGenerator);
|
$this->assertEquals($cm->idGenerator, $metadata->idGenerator);
|
||||||
$this->assertEquals($cm->customRepositoryClassName, $metadata->customRepositoryClassName);
|
$this->assertEquals($cm->customRepositoryClassName, $metadata->customRepositoryClassName);
|
||||||
|
|
||||||
|
$this->assertEquals(ClassMetadataInfo::FETCH_EXTRA_LAZY, $cm->associationMappings['comments']['fetch']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testLoadPrefixedMetadata()
|
public function testLoadPrefixedMetadata()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user