All.php 638 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace Stripe\ApiOperations;
  3. /**
  4. * Trait for listable resources. Adds a `all()` static method to the class.
  5. *
  6. * This trait should only be applied to classes that derive from StripeObject.
  7. */
  8. trait All
  9. {
  10. /**
  11. * @param null|array $params
  12. * @param null|array|string $opts
  13. *
  14. * @throws \Stripe\Exception\ApiErrorException if the request fails
  15. *
  16. * @return \Stripe\Collection of ApiResources
  17. */
  18. public static function all($params = null, $opts = null)
  19. {
  20. $url = static::classUrl();
  21. return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
  22. }
  23. }