Group_inbox.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. * Table Definition for group_inbox
  18. */
  19. defined('GNUSOCIAL') || die();
  20. class Group_inbox extends Managed_DataObject
  21. {
  22. ###START_AUTOCODE
  23. /* the code below is auto generated do not remove the above tag */
  24. public $__table = 'group_inbox'; // table name
  25. public $group_id; // int(4) primary_key not_null
  26. public $notice_id; // int(4) primary_key not_null
  27. public $created; // datetime()
  28. /* the code above is auto generated do not remove the tag below */
  29. ###END_AUTOCODE
  30. public static function schemaDef()
  31. {
  32. return array(
  33. 'description' => 'Many-many table listing notices posted to a given group, or which groups a given notice was posted to.',
  34. 'fields' => array(
  35. 'group_id' => array('type' => 'int', 'not null' => true, 'description' => 'group receiving the message'),
  36. 'notice_id' => array('type' => 'int', 'not null' => true, 'description' => 'notice received'),
  37. 'created' => array('type' => 'datetime', 'description' => 'date the notice was created'),
  38. ),
  39. 'primary key' => array('group_id', 'notice_id'),
  40. 'foreign keys' => array(
  41. 'group_inbox_group_id_fkey' => array('user_group', array('group_id' => 'id')),
  42. 'group_inbox_notice_id_fkey' => array('notice', array('notice_id' => 'id')),
  43. ),
  44. 'indexes' => array(
  45. 'group_inbox_created_idx' => array('created'),
  46. 'group_inbox_notice_id_idx' => array('notice_id'),
  47. 'group_inbox_group_id_created_notice_id_idx' => array('group_id', 'created', 'notice_id'),
  48. ),
  49. );
  50. }
  51. }