How to merge array ArrayHelpers::map?

there is a User model at the user properties first_name,last_name,mible_name I need to get id and full name of the user doing so
$user=ArrayHelper::map(User::find()->asArray()->all(),'id','last_name'." ".'first_name'.' '.'midle_name');

how do I withdraw?
June 14th 19 at 20:10
1 answer
June 14th 19 at 20:12
1. Make the method in the model
public function getName()
 return $this->last_name . '' .$this->first_name . '' .$this->middle_name; 

2. Remove from the query asArray()
$users = ArrayHelper::map(User::find()->all(), 'id', 'name');

Find more questions by tags Yii