Token.php 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Table Definition for token
  4. */
  5. require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
  6. class Token extends Managed_DataObject
  7. {
  8. ###START_AUTOCODE
  9. /* the code below is auto generated do not remove the above tag */
  10. public $__table = 'token'; // table name
  11. public $consumer_key; // varchar(191) primary_key not_null not 255 because utf8mb4 takes more space
  12. public $tok; // char(32) primary_key not_null
  13. public $secret; // char(32) not_null
  14. public $type; // tinyint(1) not_null
  15. public $state; // tinyint(1)
  16. public $verifier; // varchar(191) not 255 because utf8mb4 takes more space
  17. public $verified_callback; // varchar(191) not 255 because utf8mb4 takes more space
  18. public $created; // datetime() not_null default_0000-00-00%2000%3A00%3A00
  19. public $modified; // datetime() not_null default_CURRENT_TIMESTAMP
  20. /* the code above is auto generated do not remove the tag below */
  21. ###END_AUTOCODE
  22. public static function schemaDef()
  23. {
  24. return array(
  25. 'description' => 'OAuth token record',
  26. 'fields' => array(
  27. 'consumer_key' => array('type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'unique identifier, root URL'),
  28. 'tok' => array('type' => 'char', 'length' => 32, 'not null' => true, 'description' => 'identifying value'),
  29. 'secret' => array('type' => 'char', 'length' => 32, 'not null' => true, 'description' => 'secret value'),
  30. 'type' => array('type' => 'int', 'size' => 'tiny', 'not null' => true, 'default' => 0, 'description' => 'request or access'),
  31. 'state' => array('type' => 'int', 'size' => 'tiny', 'default' => 0, 'description' => 'for requests, 0 = initial, 1 = authorized, 2 = used'),
  32. 'verifier' => array('type' => 'varchar', 'length' => 191, 'description' => 'verifier string for OAuth 1.0a'),
  33. 'verified_callback' => array('type' => 'varchar', 'length' => 191, 'description' => 'verified callback URL for OAuth 1.0a'),
  34. 'created' => array('type' => 'datetime', 'not null' => true, 'default' => '0000-00-00 00:00:00', 'description' => 'date this record was created'),
  35. 'modified' => array('type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'),
  36. ),
  37. 'primary key' => array('consumer_key', 'tok'),
  38. 'foreign keys' => array(
  39. 'token_consumer_key_fkey' => array('consumer', array('consumer_key'=> 'consumer_key')),
  40. ),
  41. );
  42. }
  43. }