<?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);
    }
}