Skip to content

Instantly share code, notes, and snippets.

@heptat
Created May 24, 2011 07:45
Show Gist options
  • Save heptat/988277 to your computer and use it in GitHub Desktop.
Save heptat/988277 to your computer and use it in GitHub Desktop.
mapping
<?php
$unassigned_tests_records = Test::all(array('conditions' => array('id' => array('!=' => $test_ids))));
$unassigned_tests = $unassigned_tests_records->map(function($test) {
return array($test->id => $test->name);
}, array('collect' => false));
Array
(
[0] => Array
(
[1] => PAT Reading
)
[1] => Array
(
[10] => Test 1
)
)
@heptat
Copy link
Author

heptat commented May 24, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment