Skip to content

Commit 3bc7ddd

Browse files
author
Martynas Sudintas
committed
changed NamedBuilderBag::all to filter by types
1 parent b7a0d52 commit 3bc7ddd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

DSL/Aggregation/AbstractAggregation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function toArray()
134134
protected function collectNestedAggregations()
135135
{
136136
$result = [];
137-
foreach ($this->aggregations->all() as $aggregation) {
137+
foreach ($this->getAggregations() as $aggregation) {
138138
$result = array_merge($result, $aggregation->toArray());
139139
}
140140

DSL/NamedBuilderBag.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,18 @@ public function get($name)
9696
/**
9797
* Returns all builders contained.
9898
*
99-
* @param string|null $name Builder name.
99+
* @param string|null $type Builder type.
100100
*
101101
* @return NamedBuilderInterface[]
102102
*/
103-
public function all($name = null)
103+
public function all($type = null)
104104
{
105105
return array_filter(
106106
$this->bag,
107-
function ($builder) use ($name) {
107+
function ($builder) use ($type) {
108108
/** @var NamedBuilderInterface $builder */
109109

110-
return $name === null || $builder->getName() == $name;
110+
return $type === null || $builder->getType() == $type;
111111
}
112112
);
113113
}

0 commit comments

Comments
 (0)