update cart objects
authorkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Mon, 5 Jul 2010 15:53:20 +0000 (15:53 +0000)
committerkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Mon, 5 Jul 2010 15:53:20 +0000 (15:53 +0000)
update twig to newest release

git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@528 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

wob/cart.wolf

index 860b3db..aae1f75 100644 (file)
@@ -24,6 +24,9 @@
                        If null: assumed to be identical to invoiceaddress.
                </Column>
                <Column name="comment" type="text" null="yes">customer comments during order process</Column>
+               <Column name="shippingtype" type="int32" null="yes" foreignkey="shipping:shipid">
+               pointer to shipping type (none per default, programmatic default is in config)
+               </Column>
        </Table>
        <Table name="cartticket">
                <Column name="cartid" type="string:32" notnull="yes" foreignkey="cart:cartid" primarykey="yes"/>
                <Property name="maxamount" type="int" optional="1"/>
                <Property name="cartid" type="astring" optional="1">The cartID as used by the web user interface, this property must not be interpreted while the server attempts to create an order from this cart, the server must preserve it unchanged</Property>
                
+               <Property name="eventprice" type="EventPrice">Used in the Web UI only to provide access to price properties</Property>
+               <Property name="event" type="Event">Used in the Web UI only to provide access to event properties</Property>
+               
                <Mapping table="cartticket">
                        <Doc>this mapping is used by the web user interface to generate the cart object</Doc>
                        <Map property="cartid"/>
                        <Map property="eventid"/>
                        <Map property="pricecategoryid"/>
                        <Map property="amount"/>
+                       
+                       <Map property="eventprice">
+                               <Call lang="php" method="WOEventPrice::fromTableeventprice(WTeventprice::getFromDB($table->eventid,$table->pricecategoryid))"/>
+                       </Map>
+                       <Map property="event">
+                               <Call lang="php" method="WOEvent::fromTableevent(WTevent::getFromDB($table->eventid))"/>
+                       </Map>
+                       <Map property="price">
+                               <Call lang="php" method="$data->geteventprice()->getprice()"/>
+                       </Map>
                </Mapping>
        </Class>
        
                <Property name="deliveryaddressid" type="int64">The address to deliver to (mandatory)</Property>
                <Property name="invoiceaddressid" type="int64">The address to send the invoice to if different from the delivery address (optional)</Property>
                <Property name="comment" type="string">optional comments from the customer</Property>
+               <Property name="shippingid" type="int">optional shipping ID</Property>
 
                <!-- calculated properties -->
                <Property name="customer" type="Customer">The customer of this cart</Property>
                <Property name="vouchers" type="List:CartVoucher">vouchers inside this cart as seen in the DB</Property>
                <Property name="items" type="List:CartItem">shop items inside this cart as seen in the DB</Property>
                
+               <Property name="shipping" type="Shipping">if shipping is set: the shipping type</Property>
+               
                <Mapping table="cart">
                        <Map property="cartid"/>
                        <Map property="customerid"/>
                        <Map property="deliveryaddressid" column="deliveryaddress"/>
                        <Map property="invoiceaddressid" column="invoiceaddress"/>
                        <Map property="comment"/>
+                       <Map property="shippingid" column="shippingtype"/>
                        <Map property="customer">
                                <Call lang="php" method="WOCustomer::fromTablecustomer(WTcustomer::getFromDB($data->prop_customerid))"/>
                        </Map>
                        <Map property="items">
                                <Call lang="php" method="WOCartItem::fromTableArraycartitem(WTcartitem::selectFromDB('cartid='.$GLOBALS['db']->escapeString($table->cartid)))"/>
                        </Map>
+                       <Map property="shipping">
+                               <Call lang="php" method="WOShipping::fromTableshipping(WTshipping::getFromDB($table->shippingtype))"/>
+                       </Map>
                </Mapping>
        </Class>