<?php

/**
 * BaseVideo
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property string $title
 * @property string $vid
 * @property string $cover
 * @property boolean $available
 * @property Doctrine_Collection $Tags
 * @property Doctrine_Collection $VideoTags
 * 
 * @method string              getTitle()     Returns the current record's "title" value
 * @method string              getVid()       Returns the current record's "vid" value
 * @method string              getCover()     Returns the current record's "cover" value
 * @method boolean             getAvailable() Returns the current record's "available" value
 * @method Doctrine_Collection getTags()      Returns the current record's "Tags" collection
 * @method Doctrine_Collection getVideoTags() Returns the current record's "VideoTags" collection
 * @method Video               setTitle()     Sets the current record's "title" value
 * @method Video               setVid()       Sets the current record's "vid" value
 * @method Video               setCover()     Sets the current record's "cover" value
 * @method Video               setAvailable() Sets the current record's "available" value
 * @method Video               setTags()      Sets the current record's "Tags" collection
 * @method Video               setVideoTags() Sets the current record's "VideoTags" collection
 * 
 * @package    sf
 * @subpackage model
 * @author     Atma
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BaseVideo extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('video');
        $this->hasColumn('title', 'string', 512, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 512,
             ));
        $this->hasColumn('vid', 'string', 255, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 255,
             ));
        $this->hasColumn('cover', 'string', 255, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 255,
             ));
        $this->hasColumn('available', 'boolean', null, array(
             'type' => 'boolean',
             'default' => 0,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasMany('Tag as Tags', array(
             'refClass' => 'VideoTags',
             'local' => 'video_id',
             'foreign' => 'tag_id',
             'onDelete' => 'CASCADE'));

        $this->hasMany('VideoTags', array(
             'local' => 'id',
             'foreign' => 'video_id'));

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