3 final class PhortuneChargeTableView
extends AphrontView
{
8 public function setShowOrder($show_order) {
9 $this->showOrder
= $show_order;
13 public function getShowOrder() {
14 return $this->showOrder
;
17 public function setCharges(array $charges) {
18 $this->charges
= $charges;
22 public function getCharges() {
23 return $this->charges
;
26 public function render() {
27 $charges = $this->getCharges();
28 $viewer = $this->getViewer();
31 foreach ($charges as $charge) {
32 $phids[] = $charge->getCartPHID();
33 $phids[] = $charge->getProviderPHID();
34 $phids[] = $charge->getPaymentMethodPHID();
35 $phids[] = $charge->getMerchantPHID();
38 $handles = $viewer->loadHandles($phids);
41 foreach ($charges as $charge) {
44 $handles[$charge->getCartPHID()]->renderLink(),
45 $handles[$charge->getProviderPHID()]->renderLink(),
46 $charge->getPaymentMethodPHID()
47 ?
$handles[$charge->getPaymentMethodPHID()]->renderLink()
49 $handles[$charge->getMerchantPHID()]->renderLink(),
50 $charge->getAmountAsCurrency()->formatForDisplay(),
51 $charge->getStatusForDisplay(),
52 phabricator_datetime($charge->getDateCreated(), $viewer),
56 $table = id(new AphrontTableView($rows))
57 ->setNoDataString(pht('No charges found.'))
80 ->setColumnVisibility(
83 $this->getShowOrder(),