We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
why indexBy() with a anonymous function not working ? but with a column name worked. my code
print_r( Role::find() ->select(['name','id']) ->indexBy(function($row){ #exit('fire'); #not run return $row['id']*3; }) ->column() );
( [12] => a [46] => b [313] => c )
( [0] => a [1] => b [2] => c )
The text was updated successfully, but these errors were encountered:
Fixed consistency of indexBy handling for yii\db\Query::column()
indexBy
yii\db\Query::column()
62a1f25
Closes yiisoft#12649
Does it work if you use ->all();? column() will just return the first column of data so it has nothing to index with.
->all();
column()
Sorry, something went wrong.
95152f3
Query::column()
Query::indexBy()
SilverFire
Successfully merging a pull request may close this issue.
What steps will reproduce the problem?
why indexBy() with a anonymous function not working ? but with a column name worked.
my code
What is the expected result?
What do you get instead?
Additional info
The text was updated successfully, but these errors were encountered: