query and graph
This commit is contained in:
+15
-18
@@ -2,21 +2,23 @@
|
||||
|
||||
namespace Lucent\Record;
|
||||
|
||||
use Lucent\LucentException;
|
||||
use Lucent\Edge\Edge;
|
||||
use Lucent\Support\Collection;
|
||||
use PhpOption\Option;
|
||||
|
||||
class QueryRecord
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Record $record
|
||||
* @param Option<Edge> $edge
|
||||
* @param Collection<QueryRecord> $_children
|
||||
* @param Collection<QueryRecord> $_parents
|
||||
*/
|
||||
function __construct(
|
||||
public string $id,
|
||||
public string $schema,
|
||||
public Status $status,
|
||||
public System $_sys,
|
||||
public RecordData $data,
|
||||
public bool $isRoot,
|
||||
public ?File $_file = null,
|
||||
public array $_children = [],
|
||||
public array $_parents = [],
|
||||
public Record $record,
|
||||
public Option $edge,
|
||||
public Collection $_children = new Collection(),
|
||||
public Collection $_parents = new Collection(),
|
||||
)
|
||||
{
|
||||
}
|
||||
@@ -24,13 +26,8 @@ class QueryRecord
|
||||
public static function fromRecord(Record $record): QueryRecord
|
||||
{
|
||||
return new QueryRecord(
|
||||
id: $record->id,
|
||||
schema: $record->schema,
|
||||
status: $record->status,
|
||||
_sys: $record->_sys,
|
||||
data: $record->data,
|
||||
isRoot: false,
|
||||
_file: $record->_file,
|
||||
record: $record,
|
||||
edge: none(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user