Created
April 12, 2011 10:34
-
-
Save kvz/915304 to your computer and use it in GitHub Desktop.
Groups nested hour registration data & sums up the total overage in 2011 per customer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Thank you CakePHP Set::combine() & PHP5.3 : ) | |
// http://book.cakephp.org/view/1492/combine | |
$cust_overage = array_map(function ($regs) { | |
return array_sum($regs); | |
}, Set::combine( | |
$this->Hour->overage(2011), | |
'/Hour/id', | |
'/Hour/amount', | |
'/Hour/customer_id' | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment