File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
tests/Tests/ORM/Functional Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1374,6 +1374,12 @@ protected function getSelectColumnsSQL()
13741374 $ joinCondition [] = $ this ->getSQLTableAlias ($ association ['sourceEntity ' ], $ assocAlias ) . '. ' . $ sourceCol . ' = '
13751375 . $ this ->getSQLTableAlias ($ association ['targetEntity ' ]) . '. ' . $ targetCol ;
13761376 }
1377+
1378+ // Add filter SQL
1379+ $ filterSql = $ this ->generateFilterConditionSQL ($ eagerEntity , $ joinTableAlias );
1380+ if ($ filterSql ) {
1381+ $ joinCondition [] = $ filterSql ;
1382+ }
13771383 }
13781384
13791385 $ this ->currentPersisterContext ->selectJoinSql .= ' ' . $ joinTableName . ' ' . $ joinTableAlias . ' ON ' ;
Original file line number Diff line number Diff line change @@ -537,6 +537,21 @@ public function testToOneFilter(): void
537537 self ::assertEquals (2 , count ($ query ->getResult ()));
538538 }
539539
540+ public function testOneToOneInverseSideWithFilter (): void
541+ {
542+ $ this ->loadFixtureData ();
543+
544+ $ conf = $ this ->_em ->getConfiguration ();
545+ $ conf ->addFilter ('country ' , '\Doctrine\Tests\ORM\Functional\CMSCountryFilter ' );
546+ $ this ->_em ->getFilters ()->enable ('country ' )->setParameterList ('country ' , ['Germany ' ], Types::STRING );
547+
548+ $ user = $ this ->_em ->find (CmsUser::class, $ this ->userId );
549+ self ::assertNotEmpty ($ user ->address );
550+
551+ $ user2 = $ this ->_em ->find (CmsUser::class, $ this ->userId2 );
552+ self ::assertEmpty ($ user2 ->address );
553+ }
554+
540555 public function testManyToManyFilter (): void
541556 {
542557 $ this ->loadFixtureData ();
You can’t perform that action at this time.
0 commit comments