<?php

/**
 * BaseDataGroup
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property int                                              $id                                                    Type: integer, primary key
 * @property string                                           $name                                                  Type: string(255)
 * @property string                                           $description                                           Type: string(255)
 * @property int                                              $canRead                                               Type: integer(1)
 * @property int                                              $canCreate                                             Type: integer(1)
 * @property int                                              $canUpdate                                             Type: integer(1)
 * @property int                                              $canDelete                                             Type: integer(1)
 * @property Doctrine_Collection|Screen[]                     $Screens                                               
 * @property Doctrine_Collection|DataGroupScreenPermission[]  $DataGroupScreenPermission                             
 * @property Doctrine_Collection|DataGroupPermission[]        $DataGroupPermission                                   
 *  
 * @method int                                                getId()                                                Type: integer, primary key
 * @method string                                             getName()                                              Type: string(255)
 * @method string                                             getDescription()                                       Type: string(255)
 * @method int                                                getCanread()                                           Type: integer(1)
 * @method int                                                getCancreate()                                         Type: integer(1)
 * @method int                                                getCanupdate()                                         Type: integer(1)
 * @method int                                                getCandelete()                                         Type: integer(1)
 * @method Doctrine_Collection|Screen[]                       getScreens()                                           
 * @method Doctrine_Collection|DataGroupScreenPermission[]    getDataGroupScreenPermission()                         
 * @method Doctrine_Collection|DataGroupPermission[]          getDataGroupPermission()                               
 *  
 * @method DataGroup                                          setId(int $val)                                        Type: integer, primary key
 * @method DataGroup                                          setName(string $val)                                   Type: string(255)
 * @method DataGroup                                          setDescription(string $val)                            Type: string(255)
 * @method DataGroup                                          setCanread(int $val)                                   Type: integer(1)
 * @method DataGroup                                          setCancreate(int $val)                                 Type: integer(1)
 * @method DataGroup                                          setCanupdate(int $val)                                 Type: integer(1)
 * @method DataGroup                                          setCandelete(int $val)                                 Type: integer(1)
 * @method DataGroup                                          setScreens(Doctrine_Collection $val)                   
 * @method DataGroup                                          setDataGroupScreenPermission(Doctrine_Collection $val) 
 * @method DataGroup                                          setDataGroupPermission(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 BaseDataGroup extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('ohrm_data_group');
        $this->hasColumn('id', 'integer', null, array(
             'type' => 'integer',
             'primary' => true,
             'autoincrement' => true,
             ));
        $this->hasColumn('name as name', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('description as description', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('can_read as canRead', 'integer', 1, array(
             'type' => 'integer',
             'length' => 1,
             ));
        $this->hasColumn('can_create as canCreate', 'integer', 1, array(
             'type' => 'integer',
             'length' => 1,
             ));
        $this->hasColumn('can_update as canUpdate', 'integer', 1, array(
             'type' => 'integer',
             'length' => 1,
             ));
        $this->hasColumn('can_delete as canDelete', 'integer', 1, array(
             'type' => 'integer',
             'length' => 1,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasMany('Screen as Screens', array(
             'refClass' => 'DataGroupScreenPermission',
             'local' => 'data_group_id',
             'foreign' => 'screen_id'));

        $this->hasMany('DataGroupScreenPermission', array(
             'local' => 'id',
             'foreign' => 'data_group_id'));

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