Skip to content

Instantly share code, notes, and snippets.

@kcliu
Last active August 29, 2015 13:58
Show Gist options
  • Save kcliu/9939231 to your computer and use it in GitHub Desktop.
Save kcliu/9939231 to your computer and use it in GitHub Desktop.
<?php
$valueCards = \__::map($purchaseRes->getPrepayItems(), function($item) {
\__::chain()
->range($item->getTotalQuantity())
->map(function () use ($item) {
return ValueCard::create(array(
$item->getProductIdentifier() => 1,
));
})
->values();
});
$valueCards = \__::flatten($valueCards);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment