Token.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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(255) primary_key not_null
  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(255)
  17. public $verified_callback; // varchar(255)
  18. public $created; // datetime() not_null
  19. public $modified; // timestamp() 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' => 255, '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' => 255, 'description' => 'verifier string for OAuth 1.0a'),
  33. 'verified_callback' => array('type' => 'varchar', 'length' => 255, 'description' => 'verified callback URL for OAuth 1.0a'),
  34. 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
  35. 'modified' => array('type' => 'timestamp', 'not null' => true, '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. }