Skip to content

Commit a6527a8

Browse files
author
TCB13
committed
ArrayPull: Now optionally accepts an array of values instead of just one for the same property.
1 parent 5e69bd4 commit a6527a8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ArrayPull.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ public function __construct(string $property, $value)
1515

1616
public function asArray(): array
1717
{
18+
foreach ($this->value as $key => &$value) {
19+
if (is_array($value)) {
20+
$value = [
21+
"\$in" => $value
22+
];
23+
}
24+
}
1825
return [
1926
"\$pull" => [
2027
$this->name => $this->value

0 commit comments

Comments
 (0)