<?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 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 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         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->hasMany('Basket', array(
             'local' => 'id',
             'foreign' => 'basket_order_id'));

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