You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.2 KiB
PHP

<?php
class TrackingEntry {
private $status = TrackingStatus::TRACKING_STATUS_UNKNOWN;
private $details = "";
private $datetime = "";
private $location = null;
private $iscontainerscan = false;
public function __construct(int $status, string $details, string $datetime, $location = null, bool $iscontainerscan = false) {
$this->status = $status;
$this->details = $details;
$this->datetime = date("Y-m-d\TH:i:s", strtotime($datetime));
$this->location = $location;
$this->iscontainerscan = $iscontainerscan;
}
public function toString(): string {
return $this->details;
}
public function getTimestamp(): int {
return strtotime($this->datetime);
}
public function getDateTime(string $format = "Y-m-d\TH:i:s"): string {
return date($format, strtotime($this->datetime));
}
public function getLocation() {
return $this->location;
}
public function setLocation(Location $location) {
$this->location = $location;
}
public function getStatus() {
return $this->status;
}
public function isContainerScan() {
return $this->iscontainerscan;
}
}