id | country | capitol |
1 | USA | Washington DC |
2 | Japan | Tokyo |
3 | United Kingdom | London |
And you want to fetch data like this:
['Washington DC', 'Tokyo', 'London']
Then do this:
$capitols = $this->countries
->find()
->extract('capitol')
->toArray();
If you are a bloguru member, please login.
Login
If you are not a bloguru member, you may request a free account here:
Request Account