<?php

/**
 * BaseSession
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property string $id
 * @property text $session_data
 * @property integer $session_time
 * @property integer $user_id
 * @property string $token
 * @property string $device_id
 * @property User $User
 * 
 * @method string  getId()           Returns the current record's "id" value
 * @method text    getSessionData()  Returns the current record's "session_data" value
 * @method integer getSessionTime()  Returns the current record's "session_time" value
 * @method integer getUserId()       Returns the current record's "user_id" value
 * @method string  getToken()        Returns the current record's "token" value
 * @method string  getDeviceId()     Returns the current record's "device_id" value
 * @method User    getUser()         Returns the current record's "User" value
 * @method Session setId()           Sets the current record's "id" value
 * @method Session setSessionData()  Sets the current record's "session_data" value
 * @method Session setSessionTime()  Sets the current record's "session_time" value
 * @method Session setUserId()       Sets the current record's "user_id" value
 * @method Session setToken()        Sets the current record's "token" value
 * @method Session setDeviceId()     Sets the current record's "device_id" value
 * @method Session setUser()         Sets the current record's "User" value
 * 
 * @package    sf
 * @subpackage model
 * @author     Atma
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BaseSession extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('session');
        $this->hasColumn('id', 'string', 128, array(
             'type' => 'string',
             'primary' => true,
             'length' => 128,
             ));
        $this->hasColumn('session_data', 'text', null, array(
             'type' => 'text',
             ));
        $this->hasColumn('session_time', 'integer', null, array(
             'type' => 'integer',
             ));
        $this->hasColumn('user_id', 'integer', null, array(
             'type' => 'integer',
             ));
        $this->hasColumn('token', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('device_id', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasOne('User', array(
             'local' => 'user_id',
             'foreign' => 'id',
             'onDelete' => 'CASCADE'));
    }
}