2023-10-02 23:10:49 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Lucent\Record;
|
|
|
|
|
|
|
|
|
|
use Lucent\LucentException;
|
|
|
|
|
|
|
|
|
|
class QueryRecord
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
function __construct(
|
|
|
|
|
public string $id,
|
2023-10-04 13:32:30 +03:00
|
|
|
public string $schema,
|
|
|
|
|
public Status $status,
|
2023-10-02 23:10:49 +03:00
|
|
|
public System $_sys,
|
|
|
|
|
public RecordData $data,
|
|
|
|
|
public bool $isRoot,
|
|
|
|
|
public ?File $_file = null,
|
|
|
|
|
public array $_children = [],
|
2023-10-13 21:06:23 +03:00
|
|
|
public array $_parents = [],
|
2023-10-02 23:10:49 +03:00
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function fromRecord(Record $record): QueryRecord
|
|
|
|
|
{
|
|
|
|
|
return new QueryRecord(
|
|
|
|
|
id: $record->id,
|
2023-10-04 13:32:30 +03:00
|
|
|
schema: $record->schema,
|
|
|
|
|
status: $record->status,
|
2023-10-02 23:10:49 +03:00
|
|
|
_sys: $record->_sys,
|
|
|
|
|
data: $record->data,
|
|
|
|
|
isRoot: false,
|
|
|
|
|
_file: $record->_file,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|