BaseCatProduct.class.php 1.77 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
<?php

/**
 * BaseCatProduct
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property integer $cat_id
 * @property integer $product_id
 * @property Cat $Cat
 * @property Product $Product
 * 
 * @method integer    getCatId()      Returns the current record's "cat_id" value
 * @method integer    getProductId()  Returns the current record's "product_id" value
 * @method Cat        getCat()        Returns the current record's "Cat" value
 * @method Product    getProduct()    Returns the current record's "Product" value
 * @method CatProduct setCatId()      Sets the current record's "cat_id" value
 * @method CatProduct setProductId()  Sets the current record's "product_id" value
 * @method CatProduct setCat()        Sets the current record's "Cat" value
 * @method CatProduct setProduct()    Sets the current record's "Product" value
 * 
 * @package    sf
 * @subpackage model
 * @author     Atma
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BaseCatProduct extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('cat_product');
        $this->hasColumn('cat_id', 'integer', null, array(
             'type' => 'integer',
             'primary' => true,
             ));
        $this->hasColumn('product_id', 'integer', null, array(
             'type' => 'integer',
             'primary' => true,
             ));
    }

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

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