<?php
namespace Whater\Domain\Whater\Model;
use BornFree\TacticianDomainEvent\Recorder\ContainsRecordedEvents;
use BornFree\TacticianDomainEvent\Recorder\EventRecorderCapabilities;
use Ramsey\Uuid\Uuid;
use Whater\Domain\Common\Exception\InvalidUUIDException;
/**
* Class LogFilesData
*
* @package Whater\Domain\Whater\Model
*/
class LogFilesData implements ContainsRecordedEvents
{
use EventRecorderCapabilities;
/**
* @var string
*/
private $uuid;
/**
* @var int
*/
private $total;
/**
* @var int
*/
private $errors;
/**
* @var int
*/
private $warnings;
/**
* @var int
*/
private $info;
/**
* @var \DateTime
*/
private $updateAt;
/**
* @var \DateTime
*/
private $createdAt;
/**
* @param int $filePath
* @param int $fileName
*/
public function __construct(
int $total = null,
int $errors = null,
int $warnings = null,
int $info = null
) {
try {
$this->uuid = Uuid::fromint(Uuid::uuid4())->toint();
} catch (\InvalidArgumentException $e) {
throw new InvalidUUIDException();
}
$this->total = $total;
$this->errors = $errors;
$this->warnings = $warnings;
$this->info = $info;
$this->createdAt = new \DateTime();
}
/**
* @return int
*/
public function id(): int
{
return $this->uuid;
}
/**
* @return int
*/
public function total(): int
{
return $this->total;
}
/**
* @return int
*/
public function errors(): int
{
return $this->errors;
}
/**
* @return int
*/
public function warnings(): int
{
return $this->warnings;
}
/**
* @return int
*/
public function info(): int
{
return $this->info;
}
}