Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101285676
PhortuneCartViewController.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
Fri, Feb 7, 11:54
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Feb 9, 11:54 (2 d)
Engine
blob
Format
Raw Data
Handle
24128191
Attached To
rPH Phabricator
PhortuneCartViewController.php
View Options
<?php
final
class
PhortuneCartViewController
extends
PhortuneCartController
{
private
$id
;
public
function
willProcessRequest
(
array
$data
)
{
$this
->
id
=
$data
[
'id'
];
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$viewer
=
$request
->
getUser
();
$cart
=
id
(
new
PhortuneCartQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$this
->
id
))
->
needPurchases
(
true
)
->
executeOne
();
if
(!
$cart
)
{
return
new
Aphront404Response
();
}
$cart_box
=
$this
->
buildCartContents
(
$cart
);
$charges
=
id
(
new
PhortuneChargeQuery
())
->
setViewer
(
$viewer
)
->
withCartPHIDs
(
array
(
$cart
->
getPHID
()))
->
needCarts
(
true
)
->
execute
();
$charges_table
=
$this
->
buildChargesTable
(
$charges
,
false
);
$account
=
$cart
->
getAccount
();
$crumbs
=
$this
->
buildApplicationCrumbs
();
$this
->
addAccountCrumb
(
$crumbs
,
$cart
->
getAccount
());
$crumbs
->
addTextCrumb
(
pht
(
'Cart %d'
,
$cart
->
getID
()));
return
$this
->
buildApplicationPage
(
array
(
$crumbs
,
$cart_box
,
$charges_table
,
),
array
(
'title'
=>
pht
(
'Cart'
),
));
}
}
Event Timeline
Log In to Comment