<?php

/**
 * BaseOffer
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property text $inner_id
 * @property string $title
 * @property string $quantity_type
 * @property enum $quantity_type_select
 * @property integer $price
 * @property integer $product_id
 * @property text $img
 * @property boolean $is_delete
 * @property boolean $is_wholesale
 * @property integer $sort
 * @property Product $Product
 * @property Doctrine_Collection $BasketOffer
 * 
 * @method text                getInnerId()              Returns the current record's "inner_id" value
 * @method string              getTitle()                Returns the current record's "title" value
 * @method string              getQuantityType()         Returns the current record's "quantity_type" value
 * @method enum                getQuantityTypeSelect()   Returns the current record's "quantity_type_select" value
 * @method integer             getPrice()                Returns the current record's "price" value
 * @method integer             getProductId()            Returns the current record's "product_id" value
 * @method text                getImg()                  Returns the current record's "img" value
 * @method boolean             getIsDelete()             Returns the current record's "is_delete" value
 * @method boolean             getIsWholesale()          Returns the current record's "is_wholesale" value
 * @method integer             getSort()                 Returns the current record's "sort" value
 * @method Product             getProduct()              Returns the current record's "Product" value
 * @method Doctrine_Collection getBasketOffer()          Returns the current record's "BasketOffer" collection
 * @method Offer               setInnerId()              Sets the current record's "inner_id" value
 * @method Offer               setTitle()                Sets the current record's "title" value
 * @method Offer               setQuantityType()         Sets the current record's "quantity_type" value
 * @method Offer               setQuantityTypeSelect()   Sets the current record's "quantity_type_select" value
 * @method Offer               setPrice()                Sets the current record's "price" value
 * @method Offer               setProductId()            Sets the current record's "product_id" value
 * @method Offer               setImg()                  Sets the current record's "img" value
 * @method Offer               setIsDelete()             Sets the current record's "is_delete" value
 * @method Offer               setIsWholesale()          Sets the current record's "is_wholesale" value
 * @method Offer               setSort()                 Sets the current record's "sort" value
 * @method Offer               setProduct()              Sets the current record's "Product" value
 * @method Offer               setBasketOffer()          Sets the current record's "BasketOffer" collection
 * 
 * @package    sf
 * @subpackage model
 * @author     Atma
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BaseOffer extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('offer');
        $this->hasColumn('inner_id', 'text', null, array(
             'type' => 'text',
             ));
        $this->hasColumn('title', 'string', 255, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 255,
             ));
        $this->hasColumn('quantity_type', 'string', 255, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 255,
             ));
        $this->hasColumn('quantity_type_select', 'enum', null, array(
             'type' => 'enum',
             'values' => 
             array(
              0 => 'm2',
              1 => 'sheet',
              2 => 'piece',
             ),
             ));
        $this->hasColumn('price', 'integer', null, array(
             'type' => 'integer',
             'notnull' => true,
             ));
        $this->hasColumn('product_id', 'integer', null, array(
             'type' => 'integer',
             'notnull' => true,
             ));
        $this->hasColumn('img', 'text', null, array(
             'type' => 'text',
             ));
        $this->hasColumn('is_delete', 'boolean', null, array(
             'type' => 'boolean',
             'notnull' => true,
             'default' => false,
             ));
        $this->hasColumn('is_wholesale', 'boolean', null, array(
             'type' => 'boolean',
             'notnull' => true,
             'default' => false,
             ));
        $this->hasColumn('sort', 'integer', null, array(
             'type' => 'integer',
             'default' => 0,
             ));
    }

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

        $this->hasMany('BasketOffer', array(
             'local' => 'id',
             'foreign' => 'offer_id'));

        $timestampable0 = new Doctrine_Template_Timestampable();
        $i18n0 = new Doctrine_Template_I18n(array(
             'fields' => 
             array(
              0 => 'title',
              1 => 'quantity_type',
             ),
             ));
        $this->actAs($timestampable0);
        $this->actAs($i18n0);
    }
}