src/Domain/Whater/Model/LogFilesData.php line 15

Open in your IDE?
  1. <?php
  2. namespace Whater\Domain\Whater\Model;
  3. use BornFree\TacticianDomainEvent\Recorder\ContainsRecordedEvents;
  4. use BornFree\TacticianDomainEvent\Recorder\EventRecorderCapabilities;
  5. use Ramsey\Uuid\Uuid;
  6. use Whater\Domain\Common\Exception\InvalidUUIDException;
  7. /**
  8. * Class LogFilesData
  9. *
  10. * @package Whater\Domain\Whater\Model
  11. */
  12. class LogFilesData implements ContainsRecordedEvents
  13. {
  14. use EventRecorderCapabilities;
  15. /**
  16. * @var string
  17. */
  18. private $uuid;
  19. /**
  20. * @var int
  21. */
  22. private $total;
  23. /**
  24. * @var int
  25. */
  26. private $errors;
  27. /**
  28. * @var int
  29. */
  30. private $warnings;
  31. /**
  32. * @var int
  33. */
  34. private $info;
  35. /**
  36. * @var \DateTime
  37. */
  38. private $updateAt;
  39. /**
  40. * @var \DateTime
  41. */
  42. private $createdAt;
  43. /**
  44. * @param int $filePath
  45. * @param int $fileName
  46. */
  47. public function __construct(
  48. int $total = null,
  49. int $errors = null,
  50. int $warnings = null,
  51. int $info = null
  52. ) {
  53. try {
  54. $this->uuid = Uuid::fromint(Uuid::uuid4())->toint();
  55. } catch (\InvalidArgumentException $e) {
  56. throw new InvalidUUIDException();
  57. }
  58. $this->total = $total;
  59. $this->errors = $errors;
  60. $this->warnings = $warnings;
  61. $this->info = $info;
  62. $this->createdAt = new \DateTime();
  63. }
  64. /**
  65. * @return int
  66. */
  67. public function id(): int
  68. {
  69. return $this->uuid;
  70. }
  71. /**
  72. * @return int
  73. */
  74. public function total(): int
  75. {
  76. return $this->total;
  77. }
  78. /**
  79. * @return int
  80. */
  81. public function errors(): int
  82. {
  83. return $this->errors;
  84. }
  85. /**
  86. * @return int
  87. */
  88. public function warnings(): int
  89. {
  90. return $this->warnings;
  91. }
  92. /**
  93. * @return int
  94. */
  95. public function info(): int
  96. {
  97. return $this->info;
  98. }
  99. }