Skip to content

Commit

Permalink
fixing audit
Browse files Browse the repository at this point in the history
  • Loading branch information
autocode2020 committed Dec 15, 2022
1 parent c2d4992 commit 1d144e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Http/Controllers/AuditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Support\Fluent;
use \GenerCodeOrm\Exceptions as Exceptions;
use \GenerCodeOrm\InputSet;
use \GenerCodeOrm\DataSet;


class AuditController extends AppController
Expand Down
8 changes: 5 additions & 3 deletions src/Http/Controllers/RepositoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class RepositoryController extends AppController
{
private function findChildLeaves(array $children, Entity $entity = null)
{
$factory = $this->app->get("entity_factory");
if (!$entity) {
$entity = $this->entities[""];
}
Expand All @@ -26,7 +27,7 @@ private function findChildLeaves(array $children, Entity $entity = null)
$matches = [];
foreach ($id->reference as $child) {
if (in_array($child, $children)) {
$peek = ($this->profile->factory)($child);
$peek = ($factory)->create($child);
if (!$peek) {
$matches[$child] = $peek;
continue;
Expand All @@ -41,7 +42,7 @@ private function findChildLeaves(array $children, Entity $entity = null)
//if we get this far, then we new matches
$matches = array_merge($matches, $res);
} else {
$peek = ($this->profile->factory)($child);
$peek = ($factory)->create($child);
$res = $this->findChildLeaves($children, $peek);
$matches = array_merge($matches, $res);
}
Expand Down Expand Up @@ -80,6 +81,7 @@ private function tidyChildren($obj)

private function addChildren($name, $model, $children, &$rows)
{
$factory = $this->app->get("entity_factory");
if (!is_array($children)) {
$children = [$children];
}
Expand All @@ -94,7 +96,7 @@ private function addChildren($name, $model, $children, &$rows)
$idCell = $model->root->get("--id");

foreach ($idCell->reference as $branch) {
$entity = ($this->profile->factory)($branch);
$entity = ($factory)->create($branch);
$leaves = $this->findChildLeaves($children, $entity);

if (!$leaves) {
Expand Down

0 comments on commit 1d144e7

Please sign in to comment.