src/Helpers/Request/ArrayHelper.php
public function map($array, $from, $to, $group = null)
    {
        return $this->proxy(__FUNCTION__, [$array, $from, $to, $group]);
    }
public function map($array, $from, $to, $group = null)
    {
        return $this->proxy(__FUNCTION__, [$array, $from, $to, $group]);
    }
Builds a map (key-value pairs) from a multidimensional array or an array of objects.
The `$from` and `$to` parameters specify the key names or property names to set up the map.
Optionally, one can further group the map according to a grouping field `$group`.

For example,

```php
$array = [
['id' => '123', 'name' => 'aaa', 'class' => 'x'],
['id' => '124', 'name' => 'bbb', 'class' => 'x'],
['id' => '345', 'name' => 'ccc', 'class' => 'y'],
];

$result = ArrayHelper::map($array, 'id', 'name');
// the result is:
// [
//     '123' => 'aaa',
//     '124' => 'bbb',
//     '345' => 'ccc',
// ]

$result = ArrayHelper::map($array, 'id', 'name', 'class');
// the result is:
// [
//     'x' => [
//         '123' => 'aaa',
//         '124' => 'bbb',
//     ],
//     'y' => [
//         '345' => 'ccc',
//     ],
// ]
```

@param array $array
@param string|\Closure $from
@param string|\Closure $to
@param string|\Closure $group
@return array
@see \Reaction\Helpers\ArrayHelper::map()