1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-15 19:32:40 +01:00
phorge-phorge/src/applications/phortune/controller/PhortuneCartUpdateController.php

32 lines
659 B
PHP
Raw Normal View History

<?php
final class PhortuneCartUpdateController
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();
}
// TODO: This obviously doesn't do anything for now.
return id(new AphrontRedirectResponse())
->setURI($cart->getDetailURI());
}
}