RedEnvelope.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace Pingpp;
  3. class RedEnvelope extends ApiResource
  4. {
  5. /**
  6. * This is a special case because the red envelope endpoint has an
  7. * underscore in it. The parent `className` function strips underscores.
  8. *
  9. * @return string The name of the class.
  10. */
  11. public static function className()
  12. {
  13. return 'red_envelope';
  14. }
  15. /**
  16. * @param string $id The ID of the redEnvelope to retrieve.
  17. * @param array|string|null $options
  18. *
  19. * @return RedEnvelope
  20. */
  21. public static function retrieve($id, $options = null)
  22. {
  23. return self::_retrieve($id, $options);
  24. }
  25. /**
  26. * @param array|null $params
  27. * @param array|string|null $options
  28. *
  29. * @return array An array of RedEnvelope.
  30. */
  31. public static function all($params = null, $options = null)
  32. {
  33. return self::_all($params, $options);
  34. }
  35. /**
  36. * @param array|null $params
  37. * @param array|string|null $options
  38. *
  39. * @return RedEnvelope The created redEnvelope.
  40. */
  41. public static function create($params = null, $options = null)
  42. {
  43. return self::_create($params, $options);
  44. }
  45. /**
  46. * @param array|string|null $options
  47. *
  48. * @return RedEnvelope The saved redEnvelope.
  49. */
  50. public function save($options = null)
  51. {
  52. return $this->_save($options);
  53. }
  54. }