Skip to content

Commit 6300005

Browse files
committed
added 1:N relations pulling on search
1 parent 1cb6134 commit 6300005

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Model/Service/SqlService.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,12 @@ public function search(array $data = [])
459459
$fields = array_merge($fields, $relatedJson);
460460
}
461461

462-
//get N:N relations
463-
$relations = $this->schema->getRelations(3);
462+
//get 1:N, N:N relations
463+
$relations = array_merge(
464+
$this->schema->getRelations(2),
465+
$this->schema->getRelations(3)
466+
);
467+
464468
foreach ($relations as $table => $relation) {
465469
//deal with post_post at a later time
466470
if ($relation['name'] === $this->schema->getName()) {

0 commit comments

Comments
 (0)