Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phortune/view/PhortuneSubscriptionTableView.php
<?php | <?php | ||||
final class PhortuneSubscriptionTableView extends AphrontView { | final class PhortuneSubscriptionTableView extends AphrontView { | ||||
private $subscriptions; | private $subscriptions; | ||||
private $handles; | |||||
private $isMerchantView; | private $isMerchantView; | ||||
private $notice; | private $notice; | ||||
public function setHandles(array $handles) { | |||||
$this->handles = $handles; | |||||
return $this; | |||||
} | |||||
public function getHandles() { | |||||
return $this->handles; | |||||
} | |||||
public function setSubscriptions(array $subscriptions) { | public function setSubscriptions(array $subscriptions) { | ||||
$this->subscriptions = $subscriptions; | $this->subscriptions = $subscriptions; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getSubscriptions() { | public function getSubscriptions() { | ||||
return $this->subscriptions; | return $this->subscriptions; | ||||
} | } | ||||
public function setIsMerchantView($is_merchant_view) { | public function setIsMerchantView($is_merchant_view) { | ||||
$this->isMerchantView = $is_merchant_view; | $this->isMerchantView = $is_merchant_view; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getIsMerchantView() { | public function getIsMerchantView() { | ||||
return $this->isMerchantView; | return $this->isMerchantView; | ||||
} | } | ||||
public function setNotice($notice) { | public function setNotice($notice) { | ||||
$this->notice = $notice; | $this->notice = $notice; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function render() { | public function render() { | ||||
return $this->newTableView(); | |||||
} | |||||
public function newTableView() { | |||||
$subscriptions = $this->getSubscriptions(); | $subscriptions = $this->getSubscriptions(); | ||||
$handles = $this->getHandles(); | $viewer = $this->getViewer(); | ||||
$viewer = $this->getUser(); | |||||
$phids = mpull($subscriptions, 'getPHID'); | |||||
$handles = $viewer->loadHandles($phids); | |||||
$rows = array(); | $rows = array(); | ||||
$rowc = array(); | $rowc = array(); | ||||
foreach ($subscriptions as $subscription) { | foreach ($subscriptions as $subscription) { | ||||
if ($this->getIsMerchantView()) { | if ($this->getIsMerchantView()) { | ||||
$uri = $subscription->getMerchantURI(); | $uri = $subscription->getMerchantURI(); | ||||
} else { | } else { | ||||
$uri = $subscription->getURI(); | $uri = $subscription->getURI(); | ||||
Show All 34 Lines |