Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phortune/view/PhortuneChargeTableView.php
<?php | <?php | ||||
final class PhortuneChargeTableView extends AphrontView { | final class PhortuneChargeTableView extends AphrontView { | ||||
private $charges; | private $charges; | ||||
private $handles; | |||||
private $showOrder; | private $showOrder; | ||||
public function setShowOrder($show_order) { | public function setShowOrder($show_order) { | ||||
$this->showOrder = $show_order; | $this->showOrder = $show_order; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getShowOrder() { | public function getShowOrder() { | ||||
return $this->showOrder; | return $this->showOrder; | ||||
} | } | ||||
public function setHandles(array $handles) { | |||||
$this->handles = $handles; | |||||
return $this; | |||||
} | |||||
public function getHandles() { | |||||
return $this->handles; | |||||
} | |||||
public function setCharges(array $charges) { | public function setCharges(array $charges) { | ||||
$this->charges = $charges; | $this->charges = $charges; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getCharges() { | public function getCharges() { | ||||
return $this->charges; | return $this->charges; | ||||
} | } | ||||
public function render() { | public function render() { | ||||
$charges = $this->getCharges(); | $charges = $this->getCharges(); | ||||
$handles = $this->getHandles(); | $viewer = $this->getViewer(); | ||||
$viewer = $this->getUser(); | |||||
$phids = array(); | |||||
foreach ($charges as $charge) { | |||||
$phids[] = $charge->getCartPHID(); | |||||
$phids[] = $charge->getProviderPHID(); | |||||
$phids[] = $charge->getPaymentMethodPHID(); | |||||
$phids[] = $charge->getMerchantPHID(); | |||||
} | |||||
$handles = $viewer->loadHandles($phids); | |||||
$rows = array(); | $rows = array(); | ||||
foreach ($charges as $charge) { | foreach ($charges as $charge) { | ||||
$rows[] = array( | $rows[] = array( | ||||
$charge->getID(), | $charge->getID(), | ||||
$handles[$charge->getCartPHID()]->renderLink(), | $handles[$charge->getCartPHID()]->renderLink(), | ||||
$handles[$charge->getProviderPHID()]->renderLink(), | $handles[$charge->getProviderPHID()]->renderLink(), | ||||
$charge->getPaymentMethodPHID() | $charge->getPaymentMethodPHID() | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |