Files
api/services/nginx/app/objects/edge_gateway_shell_sessions_o.php
T

81 lines
3.9 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_sessions_o extends db
{
use db_object_t;
public object_property $gateway_id;
public object_property $reason;
public object_property $approval_status;
public object_property $session_token_hash;
public object_property $requested_by;
public object_property $approved_by;
public object_property $approved_at;
public object_property $expires_at;
public object_property $opened_at;
public object_property $closed_at;
public object_property $transcript_text;
public object_property $metadata_json;
public object_property $created_at;
public object_property $updated_at;
public object_property $deleted_at;
public function structure(): void
{
edge_gateway_schema_bootstrap::ensureTables();
$this->setTable('edge_gateway_shell_sessions');
}
public function getObjectProperties(): void
{
$this->gateway_id = new object_property($this->table, $this->id, 'gateway_id', 'int', false);
$this->reason = new object_property($this->table, $this->id, 'reason', 'text', false);
$this->approval_status = new object_property($this->table, $this->id, 'approval_status', 'string', false);
$this->session_token_hash = new object_property($this->table, $this->id, 'session_token_hash', 'string', false);
$this->requested_by = new object_property($this->table, $this->id, 'requested_by', 'int', false);
$this->approved_by = new object_property($this->table, $this->id, 'approved_by', 'int', false);
$this->approved_at = new object_property($this->table, $this->id, 'approved_at', 'string', false);
$this->expires_at = new object_property($this->table, $this->id, 'expires_at', 'string', false);
$this->opened_at = new object_property($this->table, $this->id, 'opened_at', 'string', false);
$this->closed_at = new object_property($this->table, $this->id, 'closed_at', 'string', false);
$this->transcript_text = new object_property($this->table, $this->id, 'transcript_text', 'text', false);
$this->metadata_json = new object_property($this->table, $this->id, 'metadata_json', 'json', false);
$this->created_at = new object_property($this->table, $this->id, 'created_at', 'timestamp', false);
$this->updated_at = new object_property($this->table, $this->id, 'updated_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(),
'reason' => (string)$this->reason->value(),
'approval_status' => (string)$this->approval_status->value(),
'requested_by' => $this->requested_by->value() === null ? null : (int)$this->requested_by->value(),
'approved_by' => $this->approved_by->value() === null ? null : (int)$this->approved_by->value(),
'approved_at' => $this->approved_at->value() === null ? null : (string)$this->approved_at->value(),
'expires_at' => (string)$this->expires_at->value(),
'opened_at' => $this->opened_at->value() === null ? null : (string)$this->opened_at->value(),
'closed_at' => $this->closed_at->value() === null ? null : (string)$this->closed_at->value(),
'transcript_text' => $this->transcript_text->value() === null ? null : (string)$this->transcript_text->value(),
'metadata' => (array)($this->metadata_json->value() ?? []),
'created_at' => (string)$this->created_at->value(),
'updated_at' => $this->updated_at->value() === null ? null : (string)$this->updated_at->value(),
];
}
}