/plugin/PBAPI/PBAPI/Methods/user.php

https://bitbucket.org/chamilo/chamilo-ext-repo-photobucket-dev/ · PHP · 114 lines · 51 code · 10 blank · 53 comment · 7 complexity · 808be89fcee202c360d3d06225beb5d3 MD5 · raw file

  1. <?php
  2. use common\libraries\Path;
  3. /**
  4. * Photobucket API
  5. * Fluent interface for PHP5
  6. * User methods
  7. *
  8. * @author Photobucket
  9. * @package PBAPI
  10. * @subpackage Methods
  11. *
  12. * @copyright Copyright Copyright (c) 2008, Photobucket, Inc.
  13. * @license http://www.opensource.org/licenses/mit-license.php The MIT License
  14. */
  15. /**
  16. * Load Methods parent
  17. */
  18. require_once dirname(__FILE__) . '/../Methods.php';
  19. /**
  20. * User Methods
  21. *
  22. * @package PBAPI
  23. * @subpackage Methods
  24. */
  25. class PBAPI_Methods_user extends PBAPI_Methods
  26. {
  27. /**
  28. * search
  29. *
  30. * @param array $params
  31. */
  32. public function search($term = null, $params = null)
  33. {
  34. $this->core->_setParamList($params);
  35. if ($term)
  36. {
  37. $this->core->_appendUri('/search/' . $term);
  38. }
  39. else
  40. {
  41. $this->core->_appendUri('/search');
  42. }
  43. }
  44. /**
  45. * URLs
  46. *
  47. * @param array $params
  48. */
  49. public function url($params = null)
  50. {
  51. $this->core->_appendUri('/url');
  52. }
  53. /**
  54. * Contacts
  55. *
  56. * @param array $params
  57. */
  58. public function contact($params = null)
  59. {
  60. $this->core->_appendUri('/contact');
  61. }
  62. /**
  63. * upload options
  64. *
  65. * @param array $params
  66. */
  67. public function uploadoption($params = null)
  68. {
  69. $this->core->_setParamList($params);
  70. $this->core->_appendUri('/uploadoption');
  71. }
  72. /**
  73. * get Tags for a user
  74. *
  75. * @param string $tagname name of a single tag to get media for
  76. * @param array $params
  77. */
  78. public function tag($tagname = '', $params = null)
  79. {
  80. if (is_array($tagname) && $params == null)
  81. {
  82. $params = $tagname;
  83. $tagname = '';
  84. }
  85. $this->core->_appendUri('/tag/%s', $tagname);
  86. $this->core->_setParamList($params);
  87. }
  88. /**
  89. * get Favorites for a user
  90. *
  91. * @param int $favid id of a single favorite
  92. * @param array $params
  93. */
  94. public function favorite($favid = '', $params = null)
  95. {
  96. if (is_array($favid) && $params == null)
  97. {
  98. $params = $favid;
  99. $favid = '';
  100. }
  101. $this->core->_appendUri('/favorite/%s', $favid);
  102. $this->core->_setParamList($params);
  103. }
  104. }