<?php
// Connection Component Binding
Doctrine_Manager::getInstance()->bindComponent('Poll', 'doctrine');

/**
 * BasePoll
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property integer $id
 * @property string $name
 * @property date $begin_date
 * @property date $end_date
 * @property timestamp $created_at
 * @property Doctrine_Collection $PollQuestion
 * @property Doctrine_Collection $PollResults
 * 
 * @method integer             getId()           Returns the current record's "id" value
 * @method string              getName()         Returns the current record's "name" value
 * @method date                getBeginDate()    Returns the current record's "begin_date" value
 * @method date                getEndDate()      Returns the current record's "end_date" value
 * @method timestamp           getCreatedAt()    Returns the current record's "created_at" value
 * @method Doctrine_Collection getPollQuestion() Returns the current record's "PollQuestion" collection
 * @method Doctrine_Collection getPollResults()  Returns the current record's "PollResults" collection
 * @method Poll                setId()           Sets the current record's "id" value
 * @method Poll                setName()         Sets the current record's "name" value
 * @method Poll                setBeginDate()    Sets the current record's "begin_date" value
 * @method Poll                setEndDate()      Sets the current record's "end_date" value
 * @method Poll                setCreatedAt()    Sets the current record's "created_at" value
 * @method Poll                setPollQuestion() Sets the current record's "PollQuestion" collection
 * @method Poll                setPollResults()  Sets the current record's "PollResults" collection
 * 
 * @package    mongolcom
 * @subpackage model
 * @author     Your name here
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BasePoll extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('poll');
        $this->hasColumn('id', 'integer', 4, array(
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => true,
             'autoincrement' => true,
             'length' => 4,
             ));
        $this->hasColumn('name', 'string', 255, array(
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             'length' => 255,
             ));
        $this->hasColumn('begin_date', 'date', 25, array(
             'type' => 'date',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => false,
             'autoincrement' => false,
             'length' => 25,
             ));
        $this->hasColumn('end_date', 'date', 25, array(
             'type' => 'date',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => false,
             'autoincrement' => false,
             'length' => 25,
             ));
        $this->hasColumn('created_at', 'timestamp', 25, array(
             'type' => 'timestamp',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             'length' => 25,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasMany('PollQuestion', array(
             'local' => 'id',
             'foreign' => 'poll_id'));

        $this->hasMany('PollResults', array(
             'local' => 'id',
             'foreign' => 'poll_id'));
    }
}