<?php

/**
 * BaseSubunit
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property int                                      $id                                            Type: integer(6), primary key
 * @property string                                   $name                                          Type: string(100)
 * @property string                                   $unitId                                        Type: string(100)
 * @property string                                   $description                                   Type: string(400)
 * @property Doctrine_Collection|PerformanceReview[]  $PerformanceReview                             
 * @property Doctrine_Collection|Employee[]           $Employee                                      
 *  
 * @method int                                        getId()                                        Type: integer(6), primary key
 * @method string                                     getName()                                      Type: string(100)
 * @method string                                     getUnitid()                                    Type: string(100)
 * @method string                                     getDescription()                               Type: string(400)
 * @method Doctrine_Collection|PerformanceReview[]    getPerformanceReview()                         
 * @method Doctrine_Collection|Employee[]             getEmployee()                                  
 *  
 * @method Subunit                                    setId(int $val)                                Type: integer(6), primary key
 * @method Subunit                                    setName(string $val)                           Type: string(100)
 * @method Subunit                                    setUnitid(string $val)                         Type: string(100)
 * @method Subunit                                    setDescription(string $val)                    Type: string(400)
 * @method Subunit                                    setPerformanceReview(Doctrine_Collection $val) 
 * @method Subunit                                    setEmployee(Doctrine_Collection $val)          
 *  
 * @package    orangehrm
 * @subpackage model
 * @author     Your name here
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BaseSubunit extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('ohrm_subunit');
        $this->hasColumn('id', 'integer', 6, array(
             'type' => 'integer',
             'primary' => true,
             'autoincrement' => true,
             'length' => 6,
             ));
        $this->hasColumn('name', 'string', 100, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 100,
             ));
        $this->hasColumn('unit_id as unitId', 'string', 100, array(
             'type' => 'string',
             'length' => 100,
             ));
        $this->hasColumn('description', 'string', 400, array(
             'type' => 'string',
             'length' => 400,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasMany('PerformanceReview', array(
             'local' => 'id',
             'foreign' => 'departmentId'));

        $this->hasMany('Employee', array(
             'local' => 'id',
             'foreign' => 'work_station'));

        $nestedset0 = new Doctrine_Template_NestedSet(array(
             ));
        $this->actAs($nestedset0);
    }
}