Skip to content

Commit

Permalink
use entity interface as target-entity in relations
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszWojdalowicz committed Jan 12, 2024
1 parent f358b03 commit 643c47a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Resources/config/doctrine/Ad.orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<field name="priority" column="priority" type="integer"/>
<field name="code" column="code"/>

<many-to-many field="banners" mapped-by="ads" target-entity="BitBag\SyliusBannerPlugin\Entity\Banner"/>
<many-to-many field="banners" mapped-by="ads" target-entity="BitBag\SyliusBannerPlugin\Entity\BannerInterface"/>

</mapped-superclass>
</doctrine-mapping>
4 changes: 2 additions & 2 deletions src/Resources/config/doctrine/Banner.orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
<join-column name="locale_id" referenced-column-name="id"/>
</many-to-one>

<many-to-one field="section" target-entity="BitBag\SyliusBannerPlugin\Entity\Section" inversed-by="banners">
<many-to-one field="section" target-entity="BitBag\SyliusBannerPlugin\Entity\SectionInterface" inversed-by="banners">
<join-column name="section_id" referenced-column-name="id"/>
</many-to-one>

<many-to-many field="ads" inversed-by="banners" target-entity="BitBag\SyliusBannerPlugin\Entity\Ad">
<many-to-many field="ads" inversed-by="banners" target-entity="BitBag\SyliusBannerPlugin\Entity\AdInterface">
<join-table name="bitbag_banners_ads">
<join-columns>
<join-column name="banner_id"/>
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/config/doctrine/Section.orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<field name="width" column="width" type="integer" nullable="true"/>
<field name="height" column="height" type="integer" nullable="true"/>

<one-to-many field="banners" target-entity="BitBag\SyliusBannerPlugin\Entity\Banner" mapped-by="section"/>
<one-to-many field="banners" target-entity="BitBag\SyliusBannerPlugin\Entity\BannerInterface" mapped-by="section"/>
</mapped-superclass>
</doctrine-mapping>

Expand Down

0 comments on commit 643c47a

Please sign in to comment.