Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3924

Custom relation table Symfony 4 and Doctrine

$
0
0

I need help to solve some task about Doctrine Relation Table.

I have two entities:

PropertyGroup

  • ID
  • Name

Property

  • ID
  • Name

This entities have a custom Many To Many relation table with extra column

PropertyAndGroupRel

  • ID
  • PropertyGroupId
  • PropertyId
  • SortKey

How can I select PropertyGroup with QueryBuilder or NativeQuery with using LIMIT and OFFSET in this view:

{  { // PropertyGroup    id: 1,    name: 'XXX',    properties: { // Properties Collection      {        id: 11,        sortKey: 1 // SORT KEY FROM PROPERTY_AND_GROUP_REL,        name: 'XXX'      },      ...    }  }  ...}

Thanks in advance!)


Viewing all articles
Browse latest Browse all 3924


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>