<?php

/**
 * This class has been auto-generated by the Doctrine ORM Framework
 */
abstract class BaseThdSegment extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('thd_segment');
        $this->hasColumn('id', 'integer', 4, array(
             'type' => 'integer',
             'unsigned' => '1',
             'primary' => true,
             'autoincrement' => true,
             'length' => '4',
             ));
        $this->hasColumn('start', 'float', 2147483647, array(
             'type' => 'float',
             'notnull' => true,
             'length' => '2147483647',
             ));
        $this->hasColumn('end', 'float', 2147483647, array(
             'type' => 'float',
             'notnull' => true,
             'length' => '2147483647',
             ));
        $this->hasColumn('user_id', 'integer', 4, array(
             'type' => 'integer',
             'unsigned' => '1',
             'notnull' => true,
             'length' => '4',
             ));
        $this->hasColumn('creation_date', 'timestamp', 25, array(
             'type' => 'timestamp',
             'notnull' => true,
             'length' => '25',
             ));
        $this->hasColumn('uniqueid', 'string', 36, array(
             'type' => 'string',
             'notnull' => true,
             'length' => '36',
             ));
        $this->hasColumn('video_id', 'integer', 4, array(
             'type' => 'integer',
             'unsigned' => '1',
             'notnull' => true,
             'length' => '4',
             ));


        $this->index('uniqueidindex', array(
             'fields' => 
             array(
              0 => 'uniqueid',
             ),
             'type' => 'unique',
             ));
    }

    public function setUp()
    {
        $this->hasOne('ThdVideo', array(
             'local' => 'video_id',
             'foreign' => 'id',
             'onDelete' => 'CASCADE'));

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

        $this->hasMany('ThdSegmentTag', array(
             'local' => 'id',
             'foreign' => 'segment_id'));
    }
}