Session.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * Table Definition for session
  4. *
  5. * StatusNet - the distributed open-source microblogging tool
  6. * Copyright (C) 2009, StatusNet, Inc.
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Affero General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. if (!defined('STATUSNET') && !defined('LACONICA')) {
  22. exit(1);
  23. }
  24. require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
  25. /**
  26. * Table definition for Session
  27. *
  28. * Superclass representing a saved session as it exists in the database.
  29. *
  30. * @author GNU social
  31. */
  32. class Session extends Managed_DataObject
  33. {
  34. ###START_AUTOCODE
  35. /* the code below is auto generated do not remove the above tag */
  36. public $__table = 'session'; // table name
  37. public $id; // varchar(32) primary_key not_null
  38. public $session_data; // text()
  39. public $created; // datetime() not_null
  40. public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
  41. /* the code above is auto generated do not remove the tag below */
  42. ###END_AUTOCODE
  43. /**
  44. * Returns an array describing how the session is stored in the database.
  45. */
  46. public static function schemaDef()
  47. {
  48. return [
  49. 'fields' => [
  50. 'id' => ['type' => 'varchar', 'length' => 32, 'not null' => true, 'description' => 'session ID'],
  51. 'session_data' => ['type' => 'text', 'description' => 'session data'],
  52. 'created' => ['type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'],
  53. 'modified' => ['type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'],
  54. ],
  55. 'primary key' => ['id'],
  56. 'indexes' => [
  57. 'session_modified_idx' => ['modified'],
  58. ],
  59. ];
  60. }
  61. }