<?php

/**
 * BaseArticle
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property string $alias
 * @property string $title
 * @property string $cover
 * @property text $description
 * @property text $body
 * @property boolean $available
 * @property Doctrine_Collection $Tags
 * @property Doctrine_Collection $ArticleTags
 * 
 * @method string              getAlias()       Returns the current record's "alias" value
 * @method string              getTitle()       Returns the current record's "title" value
 * @method string              getCover()       Returns the current record's "cover" value
 * @method text                getDescription() Returns the current record's "description" value
 * @method text                getBody()        Returns the current record's "body" 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 getArticleTags() Returns the current record's "ArticleTags" collection
 * @method Article             setAlias()       Sets the current record's "alias" value
 * @method Article             setTitle()       Sets the current record's "title" value
 * @method Article             setCover()       Sets the current record's "cover" value
 * @method Article             setDescription() Sets the current record's "description" value
 * @method Article             setBody()        Sets the current record's "body" value
 * @method Article             setAvailable()   Sets the current record's "available" value
 * @method Article             setTags()        Sets the current record's "Tags" collection
 * @method Article             setArticleTags() Sets the current record's "ArticleTags" collection
 * 
 * @package    sf
 * @subpackage model
 * @author     Atma
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BaseArticle extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('article');
        $this->hasColumn('alias', 'string', 255, array(
             'type' => 'string',
             'notnull' => true,
             'unique' => true,
             'length' => 255,
             ));
        $this->hasColumn('title', 'string', 512, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 512,
             ));
        $this->hasColumn('cover', 'string', 255, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 255,
             ));
        $this->hasColumn('description', 'text', null, array(
             'type' => 'text',
             'notnull' => true,
             ));
        $this->hasColumn('body', 'text', null, array(
             'type' => 'text',
             'notnull' => true,
             ));
        $this->hasColumn('available', 'boolean', null, array(
             'type' => 'boolean',
             'default' => 0,
             ));
    }

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

        $this->hasMany('ArticleTags', array(
             'local' => 'id',
             'foreign' => 'article_id'));

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