/
Order.orm.xml
66 lines (50 loc) · 2.46 KB
/
Order.orm.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the Sylius package.
(c) Sylius Sp. z o.o.
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<mapped-superclass name="Sylius\Component\Order\Model\Order" table="sylius_order">
<id name="id" column="id" type="integer">
<generator strategy="AUTO" />
</id>
<field name="number" column="number" type="string" unique="true" nullable="true" />
<field name="notes" column="notes" type="text" nullable="true" />
<field name="state" column="state" type="string" />
<field name="checkoutCompletedAt" column="checkout_completed_at" type="datetime" nullable="true" />
<one-to-many field="items" target-entity="Sylius\Component\Order\Model\OrderItemInterface" mapped-by="order" orphan-removal="true">
<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" />
<field name="adjustmentsTotal" column="adjustments_total" type="integer" />
<field name="total" column="total" type="integer" />
<field name="createdAt" column="created_at" type="datetime">
<gedmo:timestampable on="create"/>
</field>
<field name="updatedAt" column="updated_at" type="datetime" nullable="true">
<gedmo:timestampable on="update"/>
</field>
<indexes>
<index columns="state,updated_at"/>
</indexes>
</mapped-superclass>
</doctrine-mapping>