Skip to content

Commit f539849

Browse files
authored
MultiResult: Add methods for multiple comparation result.
1 parent cff8851 commit f539849

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

src/Entity/EngineMultiResult.php

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
namespace Mathematicator\Engine;
66

77

8+
use Mathematicator\Search\Box;
9+
810
class EngineMultiResult extends EngineResult
911
{
1012

@@ -21,6 +23,30 @@ public function getResults(): array
2123
return $this->results;
2224
}
2325

26+
/**
27+
* @return Box|null
28+
*/
29+
public function getInterpret(): ?Box
30+
{
31+
return null;
32+
}
33+
34+
/**
35+
* @return Box[]
36+
*/
37+
public function getBoxes(): array
38+
{
39+
$return = [];
40+
41+
foreach ($this->getResults() as $result) {
42+
foreach ($result->getBoxes() as $box) {
43+
$return[] = $box;
44+
}
45+
}
46+
47+
return $return;
48+
}
49+
2450
/**
2551
* @param string|null $name
2652
* @return EngineResult
@@ -53,4 +79,4 @@ public function addResult(EngineResult $result, ?string $name = null): self
5379
return $this;
5480
}
5581

56-
}
82+
}

0 commit comments

Comments
 (0)