Skip to content

Commit

Permalink
Merge pull request #99 from CodeWithDennis/revert-98
Browse files Browse the repository at this point in the history
Revert changes #98
  • Loading branch information
CodeWithDennis authored Apr 7, 2024
2 parents 21c9c13 + 27efff5 commit 76ac412
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions src/SelectTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ class SelectTree extends Field implements HasAffixActions

protected Closure|bool|null $withTrashed = false;

protected bool $storeResults = false;

protected Collection|array|null $results = null;

protected function setUp(): void
{
// Load the state from relationships using a callback function.
Expand Down Expand Up @@ -168,11 +164,6 @@ private function buildTree(): Collection
// Combine the results from both queries
$combinedResults = $nullParentResults->concat($nonNullParentResults);

// Store results for additional functionality
if ($this->storeResults) {
$this->results = $combinedResults;
}

return $this->buildTreeFromResults($combinedResults);
}

Expand Down Expand Up @@ -383,23 +374,11 @@ public function enableBranchNode(bool $enableBranchNode = true): static
return $this;
}

public function storeResults(bool $storeResults = true): static
{
$this->storeResults = $storeResults;

return $this;
}

public function getTree(): Collection|array
{
return $this->evaluate($this->buildTree());
}

public function getResults(): Collection|array|null
{
return $this->results;
}

public function getExpandSelected(): bool
{
return $this->evaluate($this->expandSelected);
Expand Down

0 comments on commit 76ac412

Please sign in to comment.