User_poll_prefs.php 2.3 KB

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