BaseBasketOrder.class.php 6.25 KB
Newer Older
Яков's avatar
first  
Яков committed
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?php

/**
 * BaseBasketOrder
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property string $username
 * @property string $phone
 * @property string $email
 * @property decimal $delivery_price
 * @property enum $delivery_type
 * @property string $delivery_address
 * @property string $comment
 * @property enum $payment_type
 * @property boolean $is_confirm
 * @property boolean $is_confirm_admin
 * @property boolean $is_payed
 * @property boolean $is_given
 * @property DiscountPhone $DiscountPhone
 * @property Doctrine_Collection $Basket
 * 
 * @method string              getUsername()         Returns the current record's "username" value
 * @method string              getPhone()            Returns the current record's "phone" value
 * @method string              getEmail()            Returns the current record's "email" value
 * @method decimal             getDeliveryPrice()    Returns the current record's "delivery_price" value
 * @method enum                getDeliveryType()     Returns the current record's "delivery_type" value
 * @method string              getDeliveryAddress()  Returns the current record's "delivery_address" value
 * @method string              getComment()          Returns the current record's "comment" value
 * @method enum                getPaymentType()      Returns the current record's "payment_type" value
 * @method boolean             getIsConfirm()        Returns the current record's "is_confirm" value
 * @method boolean             getIsConfirmAdmin()   Returns the current record's "is_confirm_admin" value
 * @method boolean             getIsPayed()          Returns the current record's "is_payed" value
 * @method boolean             getIsGiven()          Returns the current record's "is_given" value
 * @method DiscountPhone       getDiscountPhone()    Returns the current record's "DiscountPhone" value
 * @method Doctrine_Collection getBasket()           Returns the current record's "Basket" collection
 * @method BasketOrder         setUsername()         Sets the current record's "username" value
 * @method BasketOrder         setPhone()            Sets the current record's "phone" value
 * @method BasketOrder         setEmail()            Sets the current record's "email" value
 * @method BasketOrder         setDeliveryPrice()    Sets the current record's "delivery_price" value
 * @method BasketOrder         setDeliveryType()     Sets the current record's "delivery_type" value
 * @method BasketOrder         setDeliveryAddress()  Sets the current record's "delivery_address" value
 * @method BasketOrder         setComment()          Sets the current record's "comment" value
 * @method BasketOrder         setPaymentType()      Sets the current record's "payment_type" value
 * @method BasketOrder         setIsConfirm()        Sets the current record's "is_confirm" value
 * @method BasketOrder         setIsConfirmAdmin()   Sets the current record's "is_confirm_admin" value
 * @method BasketOrder         setIsPayed()          Sets the current record's "is_payed" value
 * @method BasketOrder         setIsGiven()          Sets the current record's "is_given" value
 * @method BasketOrder         setDiscountPhone()    Sets the current record's "DiscountPhone" value
 * @method BasketOrder         setBasket()           Sets the current record's "Basket" collection
 * 
 * @package    sf
 * @subpackage model
 * @author     Atma
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BaseBasketOrder extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('basket_order');
        $this->hasColumn('username', 'string', 255, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 255,
             ));
        $this->hasColumn('phone', 'string', 24, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 24,
             ));
        $this->hasColumn('email', 'string', 64, array(
             'type' => 'string',
             'length' => 64,
             ));
        $this->hasColumn('delivery_price', 'decimal', null, array(
             'type' => 'decimal',
             ));
        $this->hasColumn('delivery_type', 'enum', null, array(
             'type' => 'enum',
             'values' => 
             array(
              0 => 'Самовывоз',
              1 => 'Доставка по адресу',
             ),
             'default' => 'Самовывоз',
             'notnull' => true,
             ));
        $this->hasColumn('delivery_address', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('comment', 'string', 1000, array(
             'type' => 'string',
             'length' => 1000,
             ));
        $this->hasColumn('payment_type', 'enum', null, array(
             'type' => 'enum',
             'values' => 
             array(
              0 => 'Наличный',
              1 => 'Безналичный',
             ),
             'default' => 'Наличный',
             'notnull' => true,
             ));
        $this->hasColumn('is_confirm', 'boolean', null, array(
             'type' => 'boolean',
             'notnull' => true,
             'default' => false,
             ));
        $this->hasColumn('is_confirm_admin', 'boolean', null, array(
             'type' => 'boolean',
             'notnull' => true,
             'default' => false,
             ));
        $this->hasColumn('is_payed', 'boolean', null, array(
             'type' => 'boolean',
             'notnull' => true,
             'default' => false,
             ));
        $this->hasColumn('is_given', 'boolean', null, array(
             'type' => 'boolean',
             'notnull' => true,
             'default' => false,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasOne('DiscountPhone', array(
             'local' => 'id',
             'foreign' => 'order_id',
             'onDelete' => 'SET NULL'));

        $this->hasMany('Basket', array(
             'local' => 'id',
             'foreign' => 'basket_order_id'));

        $timestampable0 = new Doctrine_Template_Timestampable();
        $this->actAs($timestampable0);
    }
}