User_openid_prefs.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. * User_openid_prefs.php
  18. *
  19. * @category OpenID
  20. * @package GNUsocial
  21. * @author Evan Prodromou <evan@status.net>
  22. * @copyright 2012 StatusNet, Inc.
  23. * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
  24. */
  25. defined('GNUSOCIAL') || die();
  26. /**
  27. * Store preferences for OpenID use in StatusNet
  28. *
  29. * @category OpenID
  30. * @package GNUsocial
  31. * @author Evan Prodromou <evan@status.net>
  32. * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
  33. *
  34. * @see DB_DataObject
  35. */
  36. class User_openid_prefs extends Managed_DataObject
  37. {
  38. public $__table = 'user_openid_prefs'; // table name
  39. public $user_id; // The User with the prefs
  40. public $hide_profile_link; // Hide the link on the profile block?
  41. public $created; // datetime
  42. public $modified; // timestamp
  43. /**
  44. * The One True Thingy that must be defined and declared.
  45. */
  46. public static function schemaDef()
  47. {
  48. return [
  49. 'description' => 'Per-user preferences for OpenID display',
  50. 'fields' => [
  51. 'user_id' => [
  52. 'type' => 'int',
  53. 'not null' => true,
  54. 'description' => 'User whose prefs we are saving'
  55. ],
  56. 'hide_profile_link' => [
  57. 'type' => 'int',
  58. 'not null' => true,
  59. 'default' => 0,
  60. 'description' => 'Whether to hide profile links from profile block'
  61. ],
  62. 'created' => [
  63. 'type' => 'datetime',
  64. 'not null' => true,
  65. 'description' => 'date this record was created',
  66. ],
  67. 'modified' => [
  68. 'type' => 'timestamp',
  69. 'not null' => true,
  70. 'description' => 'date this record was modified',
  71. ],
  72. ],
  73. 'primary key' => ['user_id'],
  74. 'foreign keys' => [
  75. 'user_openid_prefs_user_id_fkey' => ['user', ['user_id' => 'id']],
  76. ],
  77. ];
  78. }
  79. }