<?php
// Connection Component Binding
Doctrine_Manager::getInstance()->bindComponent('Category', 'doctrine');

/**
 * BaseCategory
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property integer $id
 * @property string $name
 * @property string $enname
 * @property integer $sort_order
 * @property integer $is_visible
 * @property integer $parent_id
 * @property Doctrine_Collection $News
 * @property Doctrine_Collection $NewsCategory
 * 
 * @method integer             getId()           Returns the current record's "id" value
 * @method string              getName()         Returns the current record's "name" value
 * @method string              getEnname()       Returns the current record's "enname" value
 * @method integer             getSortOrder()    Returns the current record's "sort_order" value
 * @method integer             getIsVisible()    Returns the current record's "is_visible" value
 * @method integer             getParentId()     Returns the current record's "parent_id" value
 * @method Doctrine_Collection getNews()         Returns the current record's "News" collection
 * @method Doctrine_Collection getNewsCategory() Returns the current record's "NewsCategory" collection
 * @method Category            setId()           Sets the current record's "id" value
 * @method Category            setName()         Sets the current record's "name" value
 * @method Category            setEnname()       Sets the current record's "enname" value
 * @method Category            setSortOrder()    Sets the current record's "sort_order" value
 * @method Category            setIsVisible()    Sets the current record's "is_visible" value
 * @method Category            setParentId()     Sets the current record's "parent_id" value
 * @method Category            setNews()         Sets the current record's "News" collection
 * @method Category            setNewsCategory() Sets the current record's "NewsCategory" collection
 * 
 * @package    mongolcom
 * @subpackage model
 * @author     Your name here
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BaseCategory extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('category');
        $this->hasColumn('id', 'integer', 2, array(
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => true,
             'autoincrement' => true,
             'length' => 2,
             ));
        $this->hasColumn('name', 'string', 255, array(
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             'length' => 255,
             ));
        $this->hasColumn('enname', 'string', 255, array(
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             'length' => 255,
             ));
        $this->hasColumn('sort_order', 'integer', 2, array(
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             'length' => 2,
             ));
        $this->hasColumn('is_visible', 'integer', 1, array(
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'default' => '0',
             'notnull' => true,
             'autoincrement' => false,
             'length' => 1,
             ));
        $this->hasColumn('parent_id', 'integer', 2, array(
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'default' => '0',
             'notnull' => true,
             'autoincrement' => false,
             'length' => 2,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasMany('News', array(
             'local' => 'id',
             'foreign' => 'category_id'));

        $this->hasMany('NewsCategory', array(
             'local' => 'id',
             'foreign' => 'category_id'));
		$this->hasMany('Legal', array(
             'local' => 'id',
             'foreign' => 'category_id'));	 
    }
}