55 lines
1.8 KiB
PHP
55 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace objects;
|
|
|
|
use classes\db;
|
|
use classes\edge_gateway_schema_bootstrap;
|
|
use classes\object_property;
|
|
use traits\db_object_t;
|
|
|
|
class edge_gateway_shell_events_o extends db
|
|
{
|
|
use db_object_t;
|
|
|
|
public object_property $gateway_id;
|
|
public object_property $session_id;
|
|
public object_property $event_type;
|
|
public object_property $payload_json;
|
|
public object_property $created_at;
|
|
public object_property $deleted_at;
|
|
|
|
public function structure(): void
|
|
{
|
|
edge_gateway_schema_bootstrap::ensureTables();
|
|
$this->setTable('edge_gateway_shell_events');
|
|
}
|
|
|
|
public function getObjectProperties(): void
|
|
{
|
|
$this->gateway_id = new object_property($this->table, $this->id, 'gateway_id', 'int', false);
|
|
$this->session_id = new object_property($this->table, $this->id, 'session_id', 'int', false);
|
|
$this->event_type = new object_property($this->table, $this->id, 'event_type', 'string', false);
|
|
$this->payload_json = new object_property($this->table, $this->id, 'payload_json', 'json', false);
|
|
$this->created_at = new object_property($this->table, $this->id, 'created_at', 'timestamp', false);
|
|
$this->deleted_at = new object_property($this->table, $this->id, 'deleted_at', 'timestamp', false);
|
|
}
|
|
|
|
public function objectChanged(): void
|
|
{
|
|
}
|
|
|
|
public function asArray(): array
|
|
{
|
|
$this->requireSelected();
|
|
|
|
return [
|
|
'id' => (int)$this->id,
|
|
'gateway_id' => (int)$this->gateway_id->value(),
|
|
'session_id' => (int)$this->session_id->value(),
|
|
'event_type' => (string)$this->event_type->value(),
|
|
'payload' => (array)($this->payload_json->value() ?? []),
|
|
'created_at' => (string)$this->created_at->value(),
|
|
];
|
|
}
|
|
}
|