Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F79518061
PhortuneSubscriptionViewController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Aug 26, 21:57
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Aug 28, 21:57 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20200537
Attached To
rPH Phabricator
PhortuneSubscriptionViewController.php
View Options
<?php
final
class
PhortuneSubscriptionViewController
extends
PhortuneController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$this
->
getViewer
();
$subscription
=
id
(
new
PhortuneSubscriptionQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$request
->
getURIData
(
'id'
)))
->
needTriggers
(
true
)
->
executeOne
();
if
(!
$subscription
)
{
return
new
Aphront404Response
();
}
$is_merchant
=
(
bool
)
$request
->
getURIData
(
'merchantID'
);
$title
=
pht
(
'Subscription: %s'
,
$subscription
->
getSubscriptionName
());
$header
=
id
(
new
PHUIHeaderView
())
->
setHeader
(
$subscription
->
getSubscriptionName
());
$actions
=
id
(
new
PhabricatorActionListView
())
->
setUser
(
$viewer
)
->
setObjectURI
(
$request
->
getRequestURI
());
$crumbs
=
$this
->
buildApplicationCrumbs
();
if
(
$is_merchant
)
{
$this
->
addMerchantCrumb
(
$crumbs
,
$subscription
->
getMerchant
());
}
else
{
$this
->
addAccountCrumb
(
$crumbs
,
$subscription
->
getAccount
());
}
$crumbs
->
addTextCrumb
(
pht
(
'Subscription %d'
,
$subscription
->
getID
()));
$properties
=
id
(
new
PHUIPropertyListView
())
->
setUser
(
$viewer
)
->
setActionList
(
$actions
);
$next_invoice
=
$subscription
->
getTrigger
()->
getNextEventPrediction
();
$properties
->
addProperty
(
pht
(
'Next Invoice'
),
phabricator_datetime
(
$next_invoice
,
$viewer
));
$object_box
=
id
(
new
PHUIObjectBoxView
())
->
setHeader
(
$header
)
->
addPropertyList
(
$properties
);
return
$this
->
buildApplicationPage
(
array
(
$crumbs
,
$object_box
,
),
array
(
'title'
=>
$title
,
));
}
}
Event Timeline
Log In to Comment