<?php

declare(strict_types=1);

namespace SiteFort\Modules\Scanner\Entity;

if ( ! defined( 'ABSPATH' ) ) { exit; }


class ScanStatus {
    public $id;
    public $scan_id;
    public $ctime;
    public $level; /** 1 has highest visibility */
    public $type; /** info|error */
    public $message;

    public function __construct( $data = [] ) {
        if ( ! empty( $data ) ) {
            $this->id      = $data['id'] ?? null;
            $this->scan_id = $data['scan_id'] ?? '';
            $this->ctime   = $data['ctime'] ?? microtime( true );
            $this->level   = $data['level'] ?? 1;
            $this->type    = $data['type'] ?? 'info';
            $this->message = $data['message'] ?? '';
        }
    }
}
