mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-15 19:32:40 +01:00
32 lines
659 B
PHP
32 lines
659 B
PHP
|
<?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());
|
||
|
}
|
||
|
|
||
|
}
|