children optimization
This commit is contained in:
@@ -69,11 +69,11 @@ class RecordController extends Controller
|
|||||||
->status(explode(",", $arguments["status_in"]))
|
->status(explode(",", $arguments["status_in"]))
|
||||||
->skip($skip)
|
->skip($skip)
|
||||||
->sort($sort)
|
->sort($sort)
|
||||||
|
->childrenFields($schema->visible)
|
||||||
->childrenDepth(1)
|
->childrenDepth(1)
|
||||||
->parentsDepth(0)
|
->parentsDepth(0)
|
||||||
->runWithCount();
|
->runWithCount();
|
||||||
|
|
||||||
|
|
||||||
$records = $graph->getRootRecords()->toArray();
|
$records = $graph->getRootRecords()->toArray();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-3
@@ -47,7 +47,6 @@ final class Query
|
|||||||
public function run(): Graph
|
public function run(): Graph
|
||||||
{
|
{
|
||||||
$resultsRecords = $this->mainQuery();
|
$resultsRecords = $this->mainQuery();
|
||||||
|
|
||||||
$ids = array_map(function ($rec) {
|
$ids = array_map(function ($rec) {
|
||||||
return $rec->id;
|
return $rec->id;
|
||||||
}, $resultsRecords);
|
}, $resultsRecords);
|
||||||
@@ -183,8 +182,7 @@ final class Query
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public
|
public function limit(int $limit): Query
|
||||||
function limit(int $limit): Query
|
|
||||||
{
|
{
|
||||||
$this->options->limit = $limit;
|
$this->options->limit = $limit;
|
||||||
return $this;
|
return $this;
|
||||||
|
|||||||
Reference in New Issue
Block a user