From 9b5f1240812967e519d3c76fb2626b22124a1908 Mon Sep 17 00:00:00 2001 From: lexx Date: Mon, 15 Jan 2024 16:41:48 +0200 Subject: [PATCH] children optimization --- src/Http/Controller/RecordController.php | 2 +- src/Query/Query.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Http/Controller/RecordController.php b/src/Http/Controller/RecordController.php index 8bdfc21..3b2623d 100644 --- a/src/Http/Controller/RecordController.php +++ b/src/Http/Controller/RecordController.php @@ -69,11 +69,11 @@ class RecordController extends Controller ->status(explode(",", $arguments["status_in"])) ->skip($skip) ->sort($sort) + ->childrenFields($schema->visible) ->childrenDepth(1) ->parentsDepth(0) ->runWithCount(); - $records = $graph->getRootRecords()->toArray(); diff --git a/src/Query/Query.php b/src/Query/Query.php index 39ef10e..3d8a941 100644 --- a/src/Query/Query.php +++ b/src/Query/Query.php @@ -47,7 +47,6 @@ final class Query public function run(): Graph { $resultsRecords = $this->mainQuery(); - $ids = array_map(function ($rec) { return $rec->id; }, $resultsRecords); @@ -183,8 +182,7 @@ final class Query } - public - function limit(int $limit): Query + public function limit(int $limit): Query { $this->options->limit = $limit; return $this;