User_openid_prefs.php 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /**
  3. * StatusNet - the distributed open-source microblogging tool
  4. * Copyright (C) 2012, StatusNet, Inc.
  5. *
  6. * User_openid_prefs.php
  7. *
  8. * PHP version 5
  9. *
  10. * This program is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License as published by
  12. * the Free Software Foundation, either version 3 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. *
  23. * @category OpenID
  24. * @package StatusNet
  25. * @author Evan Prodromou <evan@status.net>
  26. * @copyright 2012 StatusNet, Inc.
  27. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
  28. * @link http://status.net/
  29. */
  30. if (!defined('STATUSNET')) {
  31. exit(1);
  32. }
  33. /**
  34. * Store preferences for OpenID use in StatusNet
  35. *
  36. * @category OpenID
  37. * @package StatusNet
  38. * @author Evan Prodromou <evan@status.net>
  39. * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  40. * @link http://status.net/
  41. *
  42. * @see DB_DataObject
  43. */
  44. class User_openid_prefs extends Managed_DataObject
  45. {
  46. public $__table = 'user_openid_prefs'; // table name
  47. public $user_id; // The User with the prefs
  48. public $hide_profile_link; // Hide the link on the profile block?
  49. public $created; // datetime
  50. public $modified; // timestamp
  51. /**
  52. * The One True Thingy that must be defined and declared.
  53. */
  54. public static function schemaDef()
  55. {
  56. return [
  57. 'description' => 'Per-user preferences for OpenID display',
  58. 'fields' => [
  59. 'user_id' => [
  60. 'type' => 'int',
  61. 'not null' => true,
  62. 'description' => 'User whose prefs we are saving'
  63. ],
  64. 'hide_profile_link' => [
  65. 'type' => 'int',
  66. 'not null' => true,
  67. 'default' => 0,
  68. 'description' => 'Whether to hide profile links from profile block'
  69. ],
  70. 'created' => [
  71. 'type' => 'datetime',
  72. 'not null' => true,
  73. 'description' => 'date this record was created',
  74. ],
  75. 'modified' => [
  76. 'type' => 'timestamp',
  77. 'not null' => true,
  78. 'description' => 'date this record was modified',
  79. ],
  80. ],
  81. 'primary key' => ['user_id'],
  82. 'foreign keys' => ['user_openid_prefs_user_id_fkey' => ['user', ['user_id' => 'id']],
  83. ],
  84. 'indexes' => [],
  85. ];
  86. }
  87. }