User_im_prefs.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 for user IM preferences
  18. *
  19. * @category Data
  20. * @package GNUsocial
  21. * @author Craig Andrews <candrews@integralblue.com>
  22. * @copyright 2009 StatusNet Inc.
  23. * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
  24. */
  25. defined('GNUSOCIAL') || die();
  26. require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
  27. class User_im_prefs extends Managed_DataObject
  28. {
  29. ###START_AUTOCODE
  30. /* the code below is auto generated do not remove the above tag */
  31. public $__table = 'user_im_prefs'; // table name
  32. public $user_id; // int(4) primary_key not_null
  33. public $screenname; // varchar(191) not_null not 255 because utf8mb4 takes more space
  34. public $transport; // varchar(191) not_null not 255 because utf8mb4 takes more space
  35. public $notify; // bool not_null default_false
  36. public $replies; // bool not_null default_false
  37. public $updatefrompresence; // bool not_null default_false
  38. public $created; // datetime() not_null default_0000-00-00%2000%3A00%3A00
  39. public $modified; // datetime() not_null default_CURRENT_TIMESTAMP
  40. /* the code above is auto generated do not remove the tag below */
  41. ###END_AUTOCODE
  42. public static function schemaDef()
  43. {
  44. return array(
  45. 'fields' => array(
  46. 'user_id' => array('type' => 'int', 'not null' => true, 'description' => 'user'),
  47. 'screenname' => array('type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'screenname on this service'),
  48. 'transport' => array('type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'transport (ex xmpp, aim)'),
  49. 'notify' => array('type' => 'bool', 'not null' => true, 'default' => false, 'description' => 'Notify when a new notice is sent'),
  50. 'replies' => array('type' => 'bool', 'not null' => true, 'default' => false, 'description' => 'Send replies from people not subscribed to'),
  51. 'updatefrompresence' => array('type' => 'bool', 'not null' => true, 'default' => false, 'description' => 'Update from presence.'),
  52. 'created' => array('type' => 'datetime', 'not null' => true, 'default' => '0000-00-00 00:00:00', 'description' => 'date this record was created'),
  53. 'modified' => array('type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'),
  54. ),
  55. 'primary key' => array('user_id', 'transport'),
  56. 'unique keys' => array(
  57. 'transport_screenname_key' => array('transport', 'screenname'),
  58. ),
  59. 'foreign keys' => array(
  60. 'user_im_prefs_user_id_fkey' => array('user', array('user_id' => 'id')),
  61. ),
  62. );
  63. }
  64. }