BaseBasketOffer.class.php 2.45 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
<?php

/**
 * BaseBasketOffer
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property integer $amount
 * @property integer $basket_id
 * @property integer $offer_id
 * @property decimal $price
 * @property Offer $Offer
 * @property Basket $Basket
 * 
 * @method integer     getAmount()    Returns the current record's "amount" value
 * @method integer     getBasketId()  Returns the current record's "basket_id" value
 * @method integer     getOfferId()   Returns the current record's "offer_id" value
 * @method decimal     getPrice()     Returns the current record's "price" value
 * @method Offer       getOffer()     Returns the current record's "Offer" value
 * @method Basket      getBasket()    Returns the current record's "Basket" value
 * @method BasketOffer setAmount()    Sets the current record's "amount" value
 * @method BasketOffer setBasketId()  Sets the current record's "basket_id" value
 * @method BasketOffer setOfferId()   Sets the current record's "offer_id" value
 * @method BasketOffer setPrice()     Sets the current record's "price" value
 * @method BasketOffer setOffer()     Sets the current record's "Offer" value
 * @method BasketOffer setBasket()    Sets the current record's "Basket" value
 * 
 * @package    sf
 * @subpackage model
 * @author     Atma
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BaseBasketOffer extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('basket_offer');
        $this->hasColumn('amount', 'integer', null, array(
             'type' => 'integer',
             'default' => 1,
             'notnull' => true,
             ));
        $this->hasColumn('basket_id', 'integer', null, array(
             'type' => 'integer',
             'notnull' => true,
             ));
        $this->hasColumn('offer_id', 'integer', null, array(
             'type' => 'integer',
             'notnull' => true,
             ));
        $this->hasColumn('price', 'decimal', null, array(
             'type' => 'decimal',
             'notnull' => true,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasOne('Offer', array(
             'local' => 'offer_id',
             'foreign' => 'id',
             'onDelete' => 'CASCADE'));

        $this->hasOne('Basket', array(
             'local' => 'basket_id',
             'foreign' => 'id',
             'onDelete' => 'CASCADE'));
    }
}