BaseSession.class.php 2.65 KB
Newer Older
Игорь's avatar
init    
Игорь committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?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'));
    }
}