Skip to content

Commit

Permalink
Merge pull request #31 from pbalcerzak/doctrine_mapping
Browse files Browse the repository at this point in the history
Changed mapping to XML
  • Loading branch information
gabriela-lubkowska authored Mar 31, 2023
2 parents b3b329a + 4a03aed commit b742299
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 73 deletions.
37 changes: 37 additions & 0 deletions src/Resources/config/doctrine/ShippingExport.orm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>

<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">

<mapped-superclass name="BitBag\SyliusShippingExportPlugin\Entity\ShippingExport" table="bitbag_shipping_export">
<id name="id" column="id" type="integer">
<generator strategy="AUTO"/>
</id>

<field name="exportedAt" column="exported_at" type="datetime" nullable="true"/>

<field name="labelPath" column="label_path" type="string" nullable="true"/>

<field name="state" column="state" type="string" nullable="false"/>

<field name="externalId" column="external_id" type="string" nullable="true"/>

<one-to-one field="shipment" target-entity="Sylius\Component\Shipping\Model\ShipmentInterface">
<cascade>
<cascade-all/>
</cascade>

<join-column name="shipment_id" referenced-column-name="id" />
</one-to-one>

<many-to-one field="shippingGateway" target-entity="BitBag\SyliusShippingExportPlugin\Entity\ShippingGatewayInterface" inversed-by="shippingExports">
<cascade>
<cascade-all/>
</cascade>

<join-column name="shipping_gateway_id" referenced-column-name="id" />
</many-to-one>
</mapped-superclass>
</doctrine-mapping>
38 changes: 0 additions & 38 deletions src/Resources/config/doctrine/ShippingExport.orm.yml

This file was deleted.

32 changes: 32 additions & 0 deletions src/Resources/config/doctrine/ShippingGateway.orm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>

<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">

<mapped-superclass name="BitBag\SyliusShippingExportPlugin\Entity\ShippingGateway" table="bitbag_shipping_gateway">
<id name="id" column="id" type="integer">
<generator strategy="AUTO"/>
</id>

<field name="code" column="code" type="string" nullable="false"/>

<field name="config" column="config" type="json_array" nullable="false"/>

<field name="name" column="name" type="string" nullable="false"/>

<many-to-many field="shippingMethods" target-entity="Sylius\Component\Core\Model\ShippingMethodInterface">
<join-table name="bitbag_shipping_gateway_method">
<join-columns>
<join-column name="shipping_gateway_id" referenced-column-name="id" nullable="false" />
</join-columns>
<inverse-join-columns>
<join-column name="shipping_method_id" referenced-column-name="id" nullable="false"/>
</inverse-join-columns>
</join-table>
</many-to-many>

<one-to-many field="shippingExports" target-entity="BitBag\SyliusShippingExportPlugin\Entity\ShippingExportInterface" mapped-by="shippingGateway" orphan-removal="true"/>
</mapped-superclass>
</doctrine-mapping>
35 changes: 0 additions & 35 deletions src/Resources/config/doctrine/ShippingGateway.orm.yml

This file was deleted.

0 comments on commit b742299

Please sign in to comment.