Yammer_user.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * Data class for remembering Yammer import mappings
  4. *
  5. * PHP version 5
  6. *
  7. * @category Data
  8. * @package StatusNet
  9. * @author Brion Vibber <brion@status.net>
  10. * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  11. * @link http://status.net/
  12. *
  13. * StatusNet - the distributed open-source microblogging tool
  14. * Copyright (C) 2010, StatusNet, Inc.
  15. *
  16. * This program is free software: you can redistribute it and/or modify
  17. * it under the terms of the GNU Affero General Public License as published by
  18. * the Free Software Foundation, either version 3 of the License, or
  19. * (at your option) any later version.
  20. *
  21. * This program is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU Affero General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU Affero General Public License
  27. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  28. */
  29. if (!defined('STATUSNET')) {
  30. exit(1);
  31. }
  32. class Yammer_user extends Yammer_common
  33. {
  34. public $__table = 'yammer_user'; // table name
  35. public $__field = 'user_id'; // field to map to
  36. public $user_id; // int
  37. /**
  38. * Return schema definition to set this table up in onCheckSchema
  39. */
  40. static function schemaDef()
  41. {
  42. return self::doSchemaDef('user_id');
  43. }
  44. /**
  45. * Save a mapping between a remote Yammer and local imported user.
  46. *
  47. * @param integer $orig_id ID of the notice in Yammer
  48. * @param integer $user_id ID of the status in StatusNet
  49. *
  50. * @return Yammer_user new object for this value
  51. */
  52. static function record($orig_id, $user_id)
  53. {
  54. return self::doRecord('Yammer_user', 'user_id', $orig_id, $user_id);
  55. }
  56. }