Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phortune/query/PhortuneCartQuery.php
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | foreach ($carts as $key => $cart) { | ||||
$account = idx($accounts, $cart->getAccountPHID()); | $account = idx($accounts, $cart->getAccountPHID()); | ||||
if (!$account) { | if (!$account) { | ||||
unset($carts[$key]); | unset($carts[$key]); | ||||
continue; | continue; | ||||
} | } | ||||
$cart->attachAccount($account); | $cart->attachAccount($account); | ||||
} | } | ||||
$implementations = array(); | |||||
$cart_map = mgroup($carts, 'getCartClass'); | |||||
foreach ($cart_map as $class => $class_carts) { | |||||
$implementations += newv($class, array())->loadImplementationsForCarts( | |||||
$this->getViewer(), | |||||
$class_carts); | |||||
} | |||||
foreach ($carts as $key => $cart) { | |||||
$implementation = idx($implementations, $key); | |||||
if (!$implementation) { | |||||
unset($carts[$key]); | |||||
continue; | |||||
} | |||||
$cart->attachImplementation($implementation); | |||||
} | |||||
return $carts; | return $carts; | ||||
} | } | ||||
protected function didFilterPage(array $carts) { | protected function didFilterPage(array $carts) { | ||||
if ($this->needPurchases) { | if ($this->needPurchases) { | ||||
$purchases = id(new PhortunePurchaseQuery()) | $purchases = id(new PhortunePurchaseQuery()) | ||||
->setViewer($this->getViewer()) | ->setViewer($this->getViewer()) | ||||
->setParentQuery($this) | ->setParentQuery($this) | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |