]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - classes/Nonce.php
Merge branch '1.0.x' into testing
[quix0rs-gnu-social.git] / classes / Nonce.php
1 <?php
2 /**
3  * Table Definition for nonce
4  */
5 require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
6
7 class Nonce extends Managed_DataObject
8 {
9     ###START_AUTOCODE
10     /* the code below is auto generated do not remove the above tag */
11
12     public $__table = 'nonce';                           // table name
13     public $consumer_key;                    // varchar(255)  primary_key not_null
14     public $tok;                             // char(32)
15     public $nonce;                           // char(32)  primary_key not_null
16     public $ts;                              // datetime()  primary_key not_null
17     public $created;                         // datetime()   not_null
18     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
19
20     /* Static get */
21     function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Nonce',$k,$v); }
22
23     /* the code above is auto generated do not remove the tag below */
24     ###END_AUTOCODE
25
26     /**
27      * Compatibility hack for PHP 5.3
28      *
29      * The statusnet.links.ini entry cannot be read because "," is no longer
30      * allowed in key names when read by parse_ini_file().
31      *
32      * @return   array
33      * @access   public
34      */
35     function links()
36     {
37         return array('consumer_key,token' => 'token:consumer_key,token');
38     }
39
40     public static function schemaDef()
41     {
42         return array(
43             'description' => 'OAuth nonce record',
44             'fields' => array(
45                 'consumer_key' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'description' => 'unique identifier, root URL'),
46                 'tok' => array('type' => 'char', 'length' => 32, 'description' => 'buggy old value, ignored'),
47                 'nonce' => array('type' => 'char', 'length' => 32, 'not null' => true, 'description' => 'nonce'),
48                 'ts' => array('type' => 'datetime', 'not null' => true, 'description' => 'timestamp sent'),
49
50                 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
51                 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
52             ),
53             'primary key' => array('consumer_key', 'ts', 'nonce'),
54         );
55     }
56 }