I have a problem here. I have a drop-down list with a users and when I click on any user, it shows a clients which are assigned to it.
Now I've added Unassigned clients selection into the drop-down top to show which clients are unassigned. I've added it with a array_unshift() command, but now in some existing users (not all of it) it's not showing any clients, but these are assigned in the database.
When I remove array_unshift, the clients shows properly, but then there are no extra selection.
I'm thinking that there are something wrong with the array_unshift(), but not sure..
Here is my select function:
public static function getUsers()
{
$query = self::find()
->select(['id', "CONCAT(name, ' ', surname, ' (', email, ')') as name"]);
$users = ArrayHelper::map($query->asArray()->all(), 'id', 'name');
array_unshift($users, 'Test'));
return $users;
}