Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F112681019
PhortuneSubscriptionTableView.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, May 12, 06:14
Size
1 KB
Mime Type
text/x-php
Expires
Wed, May 14, 06:14 (2 d)
Engine
blob
Format
Raw Data
Handle
26076829
Attached To
rPH Phabricator
PhortuneSubscriptionTableView.php
View Options
<?php
final
class
PhortuneSubscriptionTableView
extends
AphrontView
{
private
$subscriptions
;
private
$handles
;
private
$isMerchantView
;
private
$notice
;
public
function
setHandles
(
array
$handles
)
{
$this
->
handles
=
$handles
;
return
$this
;
}
public
function
getHandles
()
{
return
$this
->
handles
;
}
public
function
setSubscriptions
(
array
$subscriptions
)
{
$this
->
subscriptions
=
$subscriptions
;
return
$this
;
}
public
function
getSubscriptions
()
{
return
$this
->
subscriptions
;
}
public
function
setIsMerchantView
(
$is_merchant_view
)
{
$this
->
isMerchantView
=
$is_merchant_view
;
return
$this
;
}
public
function
getIsMerchantView
()
{
return
$this
->
isMerchantView
;
}
public
function
setNotice
(
$notice
)
{
$this
->
notice
=
$notice
;
return
$this
;
}
public
function
render
()
{
$subscriptions
=
$this
->
getSubscriptions
();
$handles
=
$this
->
getHandles
();
$viewer
=
$this
->
getUser
();
$rows
=
array
();
$rowc
=
array
();
foreach
(
$subscriptions
as
$subscription
)
{
if
(
$this
->
getIsMerchantView
())
{
$uri
=
$subscription
->
getMerchantURI
();
}
else
{
$uri
=
$subscription
->
getURI
();
}
$subscription_link
=
$handles
[
$subscription
->
getPHID
()]->
renderLink
();
$rows
[]
=
array
(
$subscription
->
getID
(),
phutil_tag
(
'a'
,
array
(
'href'
=>
$uri
,
),
$subscription
->
getSubscriptionFullName
()),
phabricator_datetime
(
$subscription
->
getDateCreated
(),
$viewer
),
);
}
$table
=
id
(
new
AphrontTableView
(
$rows
))
->
setNotice
(
$this
->
notice
)
->
setHeaders
(
array
(
pht
(
'ID'
),
pht
(
'Name'
),
pht
(
'Created'
),
))
->
setColumnClasses
(
array
(
''
,
'wide'
,
'right'
,
));
return
$table
;
}
}
Event Timeline
Log In to Comment