MultipleItemsFoundException.php 716 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace Illuminate\Support;
  3. use RuntimeException;
  4. class MultipleItemsFoundException extends RuntimeException
  5. {
  6. /**
  7. * The number of items found.
  8. *
  9. * @var int
  10. */
  11. public $count;
  12. /**
  13. * Create a new exception instance.
  14. *
  15. * @param int $count
  16. * @param int $code
  17. * @param \Throwable|null $previous
  18. */
  19. public function __construct($count, $code = 0, $previous = null)
  20. {
  21. $this->count = $count;
  22. parent::__construct("$count items were found.", $code, $previous);
  23. }
  24. /**
  25. * Get the number of items found.
  26. *
  27. * @return int
  28. */
  29. public function getCount()
  30. {
  31. return $this->count;
  32. }
  33. }