10000 [DoctrineBridge] indexBy could reference to association columns by juanmiguelbesada · Pull Request #38628 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DoctrineBridge] indexBy could reference to association columns #38628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
failing test for issue 38861
  • Loading branch information
Bart Wach authored and nicolas-grekas committed Nov 9, 2020
commit f9a0e000e93773f6c44342d5376c0c03ce3c091a
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public function testGetProperties()
'indexedBaz',
'indexedByDt',
'indexedByCustomType',
'indexedBuz',
]);

$this->assertEquals(
Expand Down Expand Up @@ -197,6 +198,14 @@ public function typesProvider()
new Type(Type::BUILTIN_TYPE_OBJECT, false, DoctrineRelation::class)
)]],
['indexedByCustomType', null],
['indexedBuz', [new Type(
Type::BUILTIN_TYPE_OBJECT,
false,
Collection::class,
true,
new Type(Type::BUILTIN_TYPE_STRING),
new Type(Type::BUILTIN_TYPE_OBJECT, false, DoctrineRelation::class)
)]],
];

if (class_exists(Types::class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,9 @@ class DoctrineDummy
* @OneToMany(targetEntity="DoctrineRelation", mappedBy="customType", indexBy="customType")
*/
private $indexedByCustomType;

/**
* @OneToMany(targetEntity="DoctrineRelation", mappedBy="buzField", indexBy="buzField")
*/
protected $indexedBuz;
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,10 @@ class DoctrineRelation
* @Column(type="foo")
*/
private $customType;

/**
* @Column(type="guid", name="different_than_field")
* @ManyToOne(targetEntity="DoctrineDummy", inversedBy="indexedBuz")
*/
protected $buzField;
}
0