<?php

/**
 * BaseProduct
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property text $inner_id
 * @property string $alias
 * @property string $title
 * @property text $description
 * @property text $chemical_composition
 * @property text $product_img
 * @property integer $supplier_id
 * @property integer $supplier_price
 * @property string $certificate
 * @property integer $offer_count
 * @property boolean $is_detail
 * @property boolean $is_delete
 * @property boolean $is_main
 * @property boolean $show_main
 * @property integer $sort
 * @property boolean $free_shipping
 * @property integer $the_weight
 * @property Doctrine_Collection $Prop
 * @property Doctrine_Collection $Cats
 * @property Suppliers $Suppliers
 * @property Doctrine_Collection $Tags
 * @property Doctrine_Collection $CatProduct
 * @property Doctrine_Collection $ProductTags
 * @property Doctrine_Collection $ProductPropValue
 * @property Doctrine_Collection $Offer
 * 
 * @method text                getInnerId()              Returns the current record's "inner_id" value
 * @method string              getAlias()                Returns the current record's "alias" value
 * @method string              getTitle()                Returns the current record's "title" value
 * @method text                getDescription()          Returns the current record's "description" value
 * @method text                getChemicalComposition()  Returns the current record's "chemical_composition" value
 * @method text                getProductImg()           Returns the current record's "product_img" value
 * @method integer             getSupplierId()           Returns the current record's "supplier_id" value
 * @method integer             getSupplierPrice()        Returns the current record's "supplier_price" value
 * @method string              getCertificate()          Returns the current record's "certificate" value
 * @method integer             getOfferCount()           Returns the current record's "offer_count" value
 * @method boolean             getIsDetail()             Returns the current record's "is_detail" value
 * @method boolean             getIsDelete()             Returns the current record's "is_delete" value
 * @method boolean             getIsMain()               Returns the current record's "is_main" value
 * @method boolean             getShowMain()             Returns the current record's "show_main" value
 * @method integer             getSort()                 Returns the current record's "sort" value
 * @method boolean             getFreeShipping()         Returns the current record's "free_shipping" value
 * @method integer             getTheWeight()            Returns the current record's "the_weight" value
 * @method Doctrine_Collection getProp()                 Returns the current record's "Prop" collection
 * @method Doctrine_Collection getCats()                 Returns the current record's "Cats" collection
 * @method Suppliers           getSuppliers()            Returns the current record's "Suppliers" value
 * @method Doctrine_Collection getTags()                 Returns the current record's "Tags" collection
 * @method Doctrine_Collection getCatProduct()           Returns the current record's "CatProduct" collection
 * @method Doctrine_Collection getProductTags()          Returns the current record's "ProductTags" collection
 * @method Doctrine_Collection getProductPropValue()     Returns the current record's "ProductPropValue" collection
 * @method Doctrine_Collection getOffer()                Returns the current record's "Offer" collection
 * @method Product             setInnerId()              Sets the current record's "inner_id" value
 * @method Product             setAlias()                Sets the current record's "alias" value
 * @method Product             setTitle()                Sets the current record's "title" value
 * @method Product             setDescription()          Sets the current record's "description" value
 * @method Product             setChemicalComposition()  Sets the current record's "chemical_composition" value
 * @method Product             setProductImg()           Sets the current record's "product_img" value
 * @method Product             setSupplierId()           Sets the current record's "supplier_id" value
 * @method Product             setSupplierPrice()        Sets the current record's "supplier_price" value
 * @method Product             setCertificate()          Sets the current record's "certificate" value
 * @method Product             setOfferCount()           Sets the current record's "offer_count" value
 * @method Product             setIsDetail()             Sets the current record's "is_detail" value
 * @method Product             setIsDelete()             Sets the current record's "is_delete" value
 * @method Product             setIsMain()               Sets the current record's "is_main" value
 * @method Product             setShowMain()             Sets the current record's "show_main" value
 * @method Product             setSort()                 Sets the current record's "sort" value
 * @method Product             setFreeShipping()         Sets the current record's "free_shipping" value
 * @method Product             setTheWeight()            Sets the current record's "the_weight" value
 * @method Product             setProp()                 Sets the current record's "Prop" collection
 * @method Product             setCats()                 Sets the current record's "Cats" collection
 * @method Product             setSuppliers()            Sets the current record's "Suppliers" value
 * @method Product             setTags()                 Sets the current record's "Tags" collection
 * @method Product             setCatProduct()           Sets the current record's "CatProduct" collection
 * @method Product             setProductTags()          Sets the current record's "ProductTags" collection
 * @method Product             setProductPropValue()     Sets the current record's "ProductPropValue" collection
 * @method Product             setOffer()                Sets the current record's "Offer" collection
 * 
 * @package    sf
 * @subpackage model
 * @author     Atma
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BaseProduct extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('product');
        $this->hasColumn('inner_id', 'text', null, array(
             'type' => 'text',
             ));
        $this->hasColumn('alias', 'string', 255, array(
             'type' => 'string',
             'notnull' => true,
             'unique' => true,
             'length' => 255,
             ));
        $this->hasColumn('title', 'string', 1000, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 1000,
             ));
        $this->hasColumn('description', 'text', null, array(
             'type' => 'text',
             ));
        $this->hasColumn('chemical_composition', 'text', null, array(
             'type' => 'text',
             ));
        $this->hasColumn('product_img', 'text', null, array(
             'type' => 'text',
             ));
        $this->hasColumn('supplier_id', 'integer', null, array(
             'type' => 'integer',
             ));
        $this->hasColumn('supplier_price', 'integer', null, array(
             'type' => 'integer',
             ));
        $this->hasColumn('certificate', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('offer_count', 'integer', null, array(
             'type' => 'integer',
             'default' => 0,
             'notnull' => true,
             ));
        $this->hasColumn('is_detail', 'boolean', null, array(
             'type' => 'boolean',
             'notnull' => true,
             'default' => true,
             ));
        $this->hasColumn('is_delete', 'boolean', null, array(
             'type' => 'boolean',
             'notnull' => true,
             'default' => false,
             ));
        $this->hasColumn('is_main', 'boolean', null, array(
             'type' => 'boolean',
             'notnull' => true,
             'default' => false,
             ));
        $this->hasColumn('show_main', 'boolean', null, array(
             'type' => 'boolean',
             'notnull' => true,
             'default' => false,
             ));
        $this->hasColumn('sort', 'integer', null, array(
             'type' => 'integer',
             'default' => 0,
             ));
        $this->hasColumn('free_shipping', 'boolean', null, array(
             'type' => 'boolean',
             'default' => false,
             ));
        $this->hasColumn('the_weight', 'integer', null, array(
             'type' => 'integer',
             'default' => 10,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasMany('ProductProp as Prop', array(
             'refClass' => 'ProductPropValue',
             'local' => 'id',
             'foreign' => 'product_id'));

        $this->hasMany('Cat as Cats', array(
             'refClass' => 'CatProduct',
             'local' => 'product_id',
             'foreign' => 'cat_id'));

        $this->hasOne('Suppliers', array(
             'local' => 'supplier_id',
             'foreign' => 'id',
             'onDelete' => 'CASCADE'));

        $this->hasMany('Tag as Tags', array(
             'refClass' => 'ProductTags',
             'local' => 'product_id',
             'foreign' => 'tag_id',
             'onDelete' => 'CASCADE'));

        $this->hasMany('CatProduct', array(
             'local' => 'id',
             'foreign' => 'product_id'));

        $this->hasMany('ProductTags', array(
             'local' => 'id',
             'foreign' => 'product_id'));

        $this->hasMany('ProductPropValue', array(
             'local' => 'id',
             'foreign' => 'product_id'));

        $this->hasMany('Offer', array(
             'local' => 'id',
             'foreign' => 'product_id'));

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