<?php

/**
 * BaseCategories
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property string $name
 * @property string $image
 * @property Doctrine_Collection $Posts
 * 
 * @method string              getName()  Returns the current record's "name" value
 * @method string              getImage() Returns the current record's "image" value
 * @method Doctrine_Collection getPosts() Returns the current record's "Posts" collection
 * @method Categories          setName()  Sets the current record's "name" value
 * @method Categories          setImage() Sets the current record's "image" value
 * @method Categories          setPosts() Sets the current record's "Posts" collection
 * 
 * @package    classifieds
 * @subpackage model
 * @author     Sandip Sathavara <sandip.sathavara@gmail.com>
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BaseCategories extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('categories');
        $this->hasColumn('name', 'string', 255, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 255,
             ));
        $this->hasColumn('image', 'string', 255, array(
             'type' => 'string',
             'notnull' => false,
             'length' => 255,
             ));

        $this->option('type', 'InnoDB');
        $this->option('collate', 'utf8_unicode_ci');
        $this->option('charset', 'utf8');
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasMany('Posts', array(
             'local' => 'id',
             'foreign' => 'cat_id',
             'onDelete' => 'CASCADE'));

        $timestampable0 = new Doctrine_Template_Timestampable();
        $i18n0 = new Doctrine_Template_I18n(array(
             'fields' => 
             array(
              0 => 'name',
              1 => 'image',
             ),
             ));
        $nestedset0 = new Doctrine_Template_NestedSet(array(
             'hasManyRoots' => true,
             'rootColumnName' => 'root_id',
             ));
        $this->actAs($timestampable0);
        $this->actAs($i18n0);
        $this->actAs($nestedset0);
    }
}