query rewrite
This commit is contained in:
+10
-18
@@ -3,12 +3,10 @@
|
||||
namespace Lucent\Revision;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Lucent\Edge\EdgeCollection;
|
||||
use Lucent\Record\FileInfo;
|
||||
use Lucent\Record\Record;
|
||||
use Lucent\Record\RecordData;
|
||||
use Lucent\Record\System;
|
||||
use PhpOption\Option;
|
||||
use Lucent\Graph\Data\FieldData;
|
||||
use Lucent\Graph\Edge\EdgeCollection;
|
||||
use Lucent\Graph\Record\Record;
|
||||
use Lucent\Graph\Record\System;
|
||||
|
||||
readonly class Revision
|
||||
{
|
||||
@@ -16,20 +14,16 @@ readonly class Revision
|
||||
/**
|
||||
* @param string $id
|
||||
* @param string $recordId
|
||||
* @param string $schema
|
||||
* @param System $_sys
|
||||
* @param RecordData $data
|
||||
* @param FieldData $data
|
||||
* @param EdgeCollection $_edges
|
||||
* @param Option<FileInfo> $_file
|
||||
*/
|
||||
function __construct(
|
||||
public string $id,
|
||||
public string $recordId,
|
||||
public string $schema,
|
||||
public System $_sys,
|
||||
public RecordData $data,
|
||||
public EdgeCollection $_edges,
|
||||
public Option $_file,
|
||||
public string $id,
|
||||
public string $recordId,
|
||||
public System $_sys,
|
||||
public FieldData $data,
|
||||
public EdgeCollection $_edges,
|
||||
|
||||
)
|
||||
{
|
||||
@@ -45,11 +39,9 @@ readonly class Revision
|
||||
return new Revision(
|
||||
id: (string)Str::uuid(),
|
||||
recordId: $record->id,
|
||||
schema: $record->schema,
|
||||
_sys: $record->_sys,
|
||||
data: $record->data,
|
||||
_edges: $edges,
|
||||
_file: empty($record->_file) ? none() : some($record->_file)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user