BaseDiscountPhone.class.php 2.79 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
<?php

/**
 * BaseDiscountPhone
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property string $phone
 * @property integer $discount_id
 * @property string $order_id
 * @property integer $active_discount
 * @property BasketOrder $BasketOrder
 * @property Discount $Discount
 * 
 * @method string        getPhone()           Returns the current record's "phone" value
 * @method integer       getDiscountId()      Returns the current record's "discount_id" value
 * @method string        getOrderId()         Returns the current record's "order_id" value
 * @method integer       getActiveDiscount()  Returns the current record's "active_discount" value
 * @method BasketOrder   getBasketOrder()     Returns the current record's "BasketOrder" value
 * @method Discount      getDiscount()        Returns the current record's "Discount" value
 * @method DiscountPhone setPhone()           Sets the current record's "phone" value
 * @method DiscountPhone setDiscountId()      Sets the current record's "discount_id" value
 * @method DiscountPhone setOrderId()         Sets the current record's "order_id" value
 * @method DiscountPhone setActiveDiscount()  Sets the current record's "active_discount" value
 * @method DiscountPhone setBasketOrder()     Sets the current record's "BasketOrder" value
 * @method DiscountPhone setDiscount()        Sets the current record's "Discount" value
 * 
 * @package    sf
 * @subpackage model
 * @author     Atma
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BaseDiscountPhone extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('discount_phone');
        $this->hasColumn('phone', 'string', 20, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 20,
             ));
        $this->hasColumn('discount_id', 'integer', null, array(
             'type' => 'integer',
             'notnull' => true,
             ));
        $this->hasColumn('order_id', 'string', 255, array(
             'type' => 'string',
             'notnull' => false,
             'length' => 255,
             ));
        $this->hasColumn('active_discount', 'integer', null, array(
             'type' => 'integer',
             'notnull' => true,
             'default' => 3,
             ));
    }

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

        $this->hasOne('Discount', array(
             'local' => 'discount_id',
             'foreign' => 'id',
             'onDelete' => 'CASCADE'));

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