mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
Default order by in to-many associations
This commit is contained in:
parent
af5ad175f8
commit
6b1eefc1a0
29 changed files with 155 additions and 11 deletions
|
|
@ -30,7 +30,8 @@
|
|||
<cascade-all/>
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="name" direction="ASC" />
|
||||
<order-by-field name="name" />
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
</mapped-superclass>
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@
|
|||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
</mapped-superclass>
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,10 @@
|
|||
>
|
||||
<mapped-superclass name="Sylius\Component\Core\Model\CatalogPromotion" table="sylius_catalog_promotion">
|
||||
<many-to-many field="channels" target-entity="Sylius\Component\Channel\Model\ChannelInterface">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<join-table name="sylius_catalog_promotion_channels">
|
||||
<join-columns>
|
||||
<join-column name="catalog_promotion_id" nullable="false" on-delete="CASCADE" />
|
||||
|
|
|
|||
|
|
@ -38,6 +38,10 @@
|
|||
<join-column name="menu_taxon_id" referenced-column-name="id" nullable="true" on-delete="SET NULL" />
|
||||
</many-to-one>
|
||||
<many-to-many field="currencies" target-entity="Sylius\Component\Currency\Model\CurrencyInterface" fetch="EAGER">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<join-table name="sylius_channel_currencies">
|
||||
<join-columns>
|
||||
<join-column name="channel_id" referenced-column-name="id" nullable="false" on-delete="CASCADE" />
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@
|
|||
</field>
|
||||
<field name="channelCode" column="channel_code" type="string" />
|
||||
<many-to-many field="appliedPromotions" target-entity="Sylius\Component\Promotion\Model\CatalogPromotionInterface">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<join-table name="sylius_channel_pricing_catalog_promotions">
|
||||
<join-columns>
|
||||
<join-column name="channel_pricing_id" nullable="false"/>
|
||||
|
|
|
|||
|
|
@ -31,11 +31,19 @@
|
|||
</one-to-one>
|
||||
|
||||
<one-to-many field="orders" target-entity="Sylius\Component\Order\Model\OrderInterface" mapped-by="customer">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<cascade>
|
||||
<cascade-all />
|
||||
</cascade>
|
||||
</one-to-many>
|
||||
<one-to-many field="addresses" target-entity="Sylius\Component\Addressing\Model\AddressInterface" mapped-by="customer">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<cascade>
|
||||
<cascade-all />
|
||||
</cascade>
|
||||
|
|
|
|||
|
|
@ -46,12 +46,20 @@
|
|||
</many-to-one>
|
||||
|
||||
<one-to-many field="payments" target-entity="Sylius\Component\Payment\Model\PaymentInterface" mapped-by="order" orphan-removal="true">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
</one-to-many>
|
||||
|
||||
<one-to-many field="shipments" target-entity="Sylius\Component\Shipping\Model\ShipmentInterface" mapped-by="order" orphan-removal="true">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
|
|
@ -65,6 +73,10 @@
|
|||
</many-to-one>
|
||||
|
||||
<many-to-many field="promotions" target-entity="Sylius\Component\Promotion\Model\PromotionInterface">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<join-table name="sylius_promotion_order">
|
||||
<join-columns>
|
||||
<join-column name="order_id" referenced-column-name="id" on-delete="CASCADE" />
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@
|
|||
|
||||
<mapped-superclass name="Sylius\Component\Core\Model\PaymentMethod" table="sylius_payment_method">
|
||||
<many-to-many field="channels" target-entity="Sylius\Component\Channel\Model\ChannelInterface">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<join-table name="sylius_payment_method_channels">
|
||||
<join-columns>
|
||||
<join-column name="payment_method_id" referenced-column-name="id" nullable="false" on-delete="CASCADE" />
|
||||
|
|
|
|||
|
|
@ -26,12 +26,20 @@
|
|||
</field>
|
||||
|
||||
<one-to-many field="productTaxons" target-entity="Sylius\Component\Core\Model\ProductTaxonInterface" mapped-by="product" orphan-removal="true">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
</one-to-many>
|
||||
|
||||
<many-to-many field="channels" target-entity="Sylius\Component\Channel\Model\ChannelInterface">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<join-table name="sylius_product_channels">
|
||||
<join-columns>
|
||||
<join-column name="product_id" referenced-column-name="id" nullable="false" on-delete="CASCADE" />
|
||||
|
|
@ -47,6 +55,10 @@
|
|||
</many-to-one>
|
||||
|
||||
<one-to-many field="images" target-entity="Sylius\Component\Core\Model\ProductImageInterface" mapped-by="owner" orphan-removal="true">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,10 @@
|
|||
<join-column name="owner_id" referenced-column-name="id" nullable="false" on-delete="CASCADE"/>
|
||||
</many-to-one>
|
||||
<many-to-many field="productVariants" target-entity="Sylius\Component\Product\Model\ProductVariantInterface" inversed-by="images">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<join-table name="sylius_product_image_product_variants">
|
||||
<join-columns>
|
||||
<join-column name="image_id" referenced-column-name="id" on-delete="CASCADE" />
|
||||
|
|
|
|||
|
|
@ -39,6 +39,10 @@
|
|||
orphan-removal="true"
|
||||
index-by="channelCode"
|
||||
>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
|
|
@ -48,6 +52,10 @@
|
|||
target-entity="Sylius\Component\Core\Model\ProductImageInterface"
|
||||
mapped-by="productVariants"
|
||||
>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<cascade>
|
||||
<cascade-persist/>
|
||||
</cascade>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,10 @@
|
|||
|
||||
<mapped-superclass name="Sylius\Component\Core\Model\Promotion" table="sylius_promotion">
|
||||
<many-to-many field="channels" target-entity="Sylius\Component\Channel\Model\ChannelInterface">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<join-table name="sylius_promotion_channels">
|
||||
<join-columns>
|
||||
<join-column name="promotion_id" referenced-column-name="id" nullable="false" on-delete="CASCADE" />
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@
|
|||
<field name="adjustmentsTotal" column="adjustments_total" type="integer" />
|
||||
|
||||
<one-to-many field="adjustments" target-entity="Sylius\Component\Core\Model\AdjustmentInterface" mapped-by="shipment" orphan-removal="true">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,10 @@
|
|||
</many-to-one>
|
||||
|
||||
<many-to-many field="channels" target-entity="Sylius\Component\Channel\Model\ChannelInterface">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<join-table name="sylius_shipping_method_channels">
|
||||
<join-columns>
|
||||
<join-column name="shipping_method_id" referenced-column-name="id" nullable="false" on-delete="CASCADE" />
|
||||
|
|
|
|||
|
|
@ -26,6 +26,10 @@
|
|||
</field>
|
||||
|
||||
<one-to-many field="images" target-entity="Sylius\Component\Core\Model\TaxonImageInterface" mapped-by="owner" orphan-removal="true">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
|
|
|
|||
|
|
@ -33,12 +33,18 @@
|
|||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
|
||||
<one-to-many field="adjustments" target-entity="Sylius\Component\Order\Model\AdjustmentInterface" mapped-by="order" orphan-removal="true">
|
||||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
|
||||
<field name="itemsTotal" column="items_total" type="integer" />
|
||||
|
|
|
|||
|
|
@ -37,12 +37,18 @@
|
|||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
|
||||
<one-to-many field="units" target-entity="Sylius\Component\Order\Model\OrderItemUnitInterface" mapped-by="orderItem" orphan-removal="true">
|
||||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
</mapped-superclass>
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@
|
|||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
</mapped-superclass>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@
|
|||
<cascade>
|
||||
<cascade-all />
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
|
||||
<one-to-many field="variants" target-entity="Sylius\Component\Product\Model\ProductVariantInterface" mapped-by="product" orphan-removal="true">
|
||||
|
|
@ -31,7 +34,8 @@
|
|||
<cascade-all />
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="position" direction="ASC" />
|
||||
<order-by-field name="position" />
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
|
||||
|
|
@ -40,7 +44,8 @@
|
|||
<cascade-persist />
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="position" direction="ASC" />
|
||||
<order-by-field name="position" />
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
<join-table name="sylius_product_options">
|
||||
<join-columns>
|
||||
|
|
@ -52,6 +57,15 @@
|
|||
</join-table>
|
||||
</many-to-many>
|
||||
|
||||
<one-to-many field="associations" target-entity="Sylius\Component\Product\Model\ProductAssociationInterface" mapped-by="owner" orphan-removal="true">
|
||||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
|
||||
<field name="createdAt" column="created_at" type="datetime">
|
||||
<gedmo:timestampable on="create"/>
|
||||
</field>
|
||||
|
|
@ -60,12 +74,6 @@
|
|||
<gedmo:timestampable on="update"/>
|
||||
</field>
|
||||
<field name="enabled" column="enabled" type="boolean" />
|
||||
|
||||
<one-to-many field="associations" target-entity="Sylius\Component\Product\Model\ProductAssociationInterface" mapped-by="owner" orphan-removal="true">
|
||||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
</one-to-many>
|
||||
</mapped-superclass>
|
||||
|
||||
</doctrine-mapping>
|
||||
|
|
|
|||
|
|
@ -43,6 +43,10 @@
|
|||
</many-to-one>
|
||||
|
||||
<many-to-many field="associatedProducts" target-entity="Sylius\Component\Product\Model\ProductInterface">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<join-table name="sylius_product_association_product">
|
||||
<join-columns>
|
||||
<join-column name="association_id" referenced-column-name="id" nullable="false" unique="false" on-delete="CASCADE" />
|
||||
|
|
|
|||
|
|
@ -36,7 +36,12 @@
|
|||
</field>
|
||||
|
||||
<one-to-many target-entity="Sylius\Component\Product\Model\ProductOptionValueInterface" mapped-by="option" field="values" orphan-removal="true">
|
||||
<cascade><cascade-all /></cascade>
|
||||
<cascade>
|
||||
<cascade-all />
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
</mapped-superclass>
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,10 @@
|
|||
</many-to-one>
|
||||
|
||||
<many-to-many target-entity="Sylius\Component\Product\Model\ProductOptionValueInterface" field="optionValues">
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
|
||||
<join-table name="sylius_product_variant_option_value">
|
||||
<join-columns>
|
||||
<join-column name="variant_id" referenced-column-name="id" unique="false" nullable="false" on-delete="CASCADE" />
|
||||
|
|
|
|||
|
|
@ -39,11 +39,17 @@
|
|||
<cascade>
|
||||
<cascade-all />
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
<one-to-many field="actions" target-entity="Sylius\Component\Promotion\Model\CatalogPromotionActionInterface" mapped-by="catalogPromotion" orphan-removal="true">
|
||||
<cascade>
|
||||
<cascade-all />
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
</mapped-superclass>
|
||||
</doctrine-mapping>
|
||||
|
|
|
|||
|
|
@ -39,16 +39,25 @@
|
|||
<cascade>
|
||||
<cascade-all />
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
<one-to-many field="rules" target-entity="Sylius\Component\Promotion\Model\PromotionRuleInterface" mapped-by="promotion" orphan-removal="true">
|
||||
<cascade>
|
||||
<cascade-all />
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
<one-to-many field="actions" target-entity="Sylius\Component\Promotion\Model\PromotionActionInterface" mapped-by="promotion" orphan-removal="true">
|
||||
<cascade>
|
||||
<cascade-all />
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
|
||||
<field name="createdAt" column="created_at" type="datetime">
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@
|
|||
<cascade>
|
||||
<cascade-persist/>
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
|
||||
<field name="createdAt" column="created_at" type="datetime">
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@
|
|||
<cascade>
|
||||
<cascade-all />
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
|
||||
<field name="categoryRequirement" column="category_requirement" type="integer" />
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@
|
|||
<cascade>
|
||||
<cascade-all/>
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
|
||||
<field name="createdAt" column="created_at" type="datetime">
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@
|
|||
<cascade-persist />
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="position" direction="ASC" />
|
||||
<order-by-field name="position" />
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,9 @@
|
|||
<cascade>
|
||||
<cascade-all />
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="id" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
</mapped-superclass>
|
||||
</doctrine-mapping>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue