summaryrefslogtreecommitdiffstats
path: root/src/Psecio/Gatekeeper/AuthTokenModel.php
blob: 59bb41e0aad53a4aed83642914338422c3bf4c0d (plain)
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
<?php

namespace Psecio\Gatekeeper;

class AuthTokenModel extends \Psecio\Gatekeeper\Model\Mysql
{
    /**
     * Database table name
     * @var string
     */
    protected $tableName = 'auth_tokens';

    /**
     * Model properties
     * @var array
     */
    protected $properties = array(
        'id' => array(
            'description' => 'Token ID',
            'column' => 'id',
            'type' => 'integer'
        ),
        'token' => array(
            'description' => 'Token value',
            'column' => 'token',
            'type' => 'varchar'
        ),
        'verifier' => array(
            'description' => 'Verifier value',
            'column' => 'verifier',
            'type' => 'varchar'
        ),
        'userId' => array(
            'description' => 'User ID',
            'column' => 'user_id',
            'type' => 'integer'
        ),
        'user' => array(
            'description' => 'User related to token',
            'type' => 'relation',
            'relation' => array(
                'model' => '\\Psecio\\Gatekeeper\\UserModel',
                'method' => 'findByUserId',
                'local' => 'userId'
            )
        ),
        'expires' => array(
            'description' => 'Date Token Expires',
            'column' => 'expires',
            'type' => 'datetime'
        ),
        'created' => array(
            'description' => 'Date Created',
            'column' => 'created',
            'type' => 'datetime'
        ),
        'updated' => array(
            'description' => 'Date Updated',
            'column' => 'updated',
            'type' => 'datetime'
        ),
    );
}