We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 994173b + debfec1 commit 552ac7eCopy full SHA for 552ac7e
src/QueryEngine.php
@@ -733,6 +733,28 @@ public function transform(callable $fn)
733
734
return $this;
735
}
736
+
737
738
+ /**
739
+ * map prepared data by using callable function for each entity
740
+ *
741
+ * @param callable $fn
742
+ * @return object|array
743
+ * @throws ConditionNotAllowedException
744
+ */
745
+ public function map(callable $fn)
746
+ {
747
+ $this->prepare();
748
+ $data = [];
749
750
+ foreach ($this->_map as $key => $val) {
751
+ $data[$key] = $fn($val);
752
+ }
753
754
+ $this->_map = $data;
755
756
+ return $this;
757
758
759
/**
760
* pipe send output in next pipe
0 commit comments