User_poll_prefs.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /**
  3. * Data class to record user prefs for polls
  4. *
  5. * PHP version 5
  6. *
  7. * @category PollPlugin
  8. * @package StatusNet
  9. * @author Evan Prodromou <evan@status.net>
  10. * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  11. * @link http://status.net/
  12. *
  13. * StatusNet - the distributed open-source microblogging tool
  14. * Copyright (C) 2012, StatusNet, Inc.
  15. *
  16. * This program is free software: you can redistribute it and/or modify
  17. * it under the terms of the GNU Affero General Public License as published by
  18. * the Free Software Foundation, either version 3 of the License, or
  19. * (at your option) any later version.
  20. *
  21. * This program is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU Affero General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU Affero General Public License
  27. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  28. */
  29. if (!defined('STATUSNET')) {
  30. exit(1);
  31. }
  32. /**
  33. * For storing the poll prefs
  34. *
  35. * @category PollPlugin
  36. * @package StatusNet
  37. * @author Brion Vibber <brion@status.net>
  38. * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  39. * @link http://status.net/
  40. *
  41. * @see DB_DataObject
  42. */
  43. class User_poll_prefs extends Managed_DataObject
  44. {
  45. public $__table = 'user_poll_prefs'; // table name
  46. public $user_id; // int id
  47. public $hide_responses; // boolean
  48. public $created; // datetime
  49. public $modified; // datetime
  50. /**
  51. * The One True Thingy that must be defined and declared.
  52. */
  53. public static function schemaDef()
  54. {
  55. return array(
  56. 'description' => 'Record of user preferences for polls',
  57. 'fields' => array(
  58. 'user_id' => array('type' => 'int', 'not null' => true, 'description' => 'user id'),
  59. 'hide_responses' => array('type' => 'int', 'size' => 'tiny', 'default' => 0, 'description' => 'Hide all poll responses'),
  60. 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
  61. 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
  62. ),
  63. 'primary key' => array('user_id')
  64. );
  65. }
  66. }