Skip to content

Commit c9927be

Browse files
committed
Merge branch '3.1'
* 3.1: fixed Twig support for 1.26 and 2.0 Fix indexBy type extraction
2 parents 4f90563 + 210b9f6 commit c9927be

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

PropertyInfo/DoctrineExtractor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ public function getTypes($class, $property, array $context = array())
8888

8989
if (isset($associationMapping['indexBy'])) {
9090
$indexProperty = $associationMapping['indexBy'];
91-
$typeOfField = $metadata->getTypeOfField($indexProperty);
91+
$subMetadata = $this->classMetadataFactory->getMetadataFor($associationMapping['targetEntity']);
92+
$typeOfField = $subMetadata->getTypeOfField($indexProperty);
9293

9394
$collectionKeyType = $this->getPhpType($typeOfField);
9495
}

Tests/PropertyInfo/Fixtures/DoctrineDummy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class DoctrineDummy
4141
public $bar;
4242

4343
/**
44-
* @ManyToMany(targetEntity="DoctrineRelation", indexBy="guid")
44+
* @ManyToMany(targetEntity="DoctrineRelation", indexBy="rguid")
4545
*/
4646
protected $indexedBar;
4747

Tests/PropertyInfo/Fixtures/DoctrineRelation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ class DoctrineRelation
3131
/**
3232
* @Column(type="guid")
3333
*/
34-
protected $guid;
34+
protected $rguid;
3535
}

0 commit comments

Comments
 (0)