MultipleItemsFoundException.php 736 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. * @return void
  19. */
  20. public function __construct($count, $code = 0, $previous = null)
  21. {
  22. $this->count = $count;
  23. parent::__construct("$count items were found.", $code, $previous);
  24. }
  25. /**
  26. * Get the number of items found.
  27. *
  28. * @return int
  29. */
  30. public function getCount()
  31. {
  32. return $this->count;
  33. }
  34. }