Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phortune/editor/PhortuneCartEditor.php
| Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | $body->addLinkSection( | ||||
| PhabricatorEnv::getProductionURI($account_uri)); | PhabricatorEnv::getProductionURI($account_uri)); | ||||
| return $body; | return $body; | ||||
| } | } | ||||
| protected function getMailTo(PhabricatorLiskDAO $object) { | protected function getMailTo(PhabricatorLiskDAO $object) { | ||||
| $phids = array(); | $phids = array(); | ||||
| // Relaod the cart to pull merchant and account information, in case we | // Reload the cart to pull merchant and account information, in case we | ||||
| // just created the object. | // just created the object. | ||||
| $cart = id(new PhortuneCartQuery()) | $cart = id(new PhortuneCartQuery()) | ||||
| ->setViewer($this->requireActor()) | ->setViewer($this->requireActor()) | ||||
| ->withPHIDs(array($object->getPHID())) | ->withPHIDs(array($object->getPHID())) | ||||
| ->executeOne(); | ->executeOne(); | ||||
| foreach ($cart->getAccount()->getMemberPHIDs() as $account_member) { | foreach ($cart->getAccount()->getMemberPHIDs() as $account_member) { | ||||
| $phids[] = $account_member; | $phids[] = $account_member; | ||||
| Show All 14 Lines | protected function getMailSubjectPrefix() { | ||||
| return '[Phortune]'; | return '[Phortune]'; | ||||
| } | } | ||||
| protected function buildReplyHandler(PhabricatorLiskDAO $object) { | protected function buildReplyHandler(PhabricatorLiskDAO $object) { | ||||
| return id(new PhortuneCartReplyHandler()) | return id(new PhortuneCartReplyHandler()) | ||||
| ->setMailReceiver($object); | ->setMailReceiver($object); | ||||
| } | } | ||||
| protected function willPublish(PhabricatorLiskDAO $object, array $xactions) { | |||||
| // We need the purchases in order to build mail. | |||||
| return id(new PhortuneCartQuery()) | |||||
| ->setViewer($this->getActor()) | |||||
| ->withIDs(array($object->getID())) | |||||
| ->needPurchases(true) | |||||
| ->executeOne(); | |||||
| } | |||||
| protected function getCustomWorkerState() { | |||||
| return array( | |||||
| 'invoiceIssues' => $this->invoiceIssues, | |||||
| ); | |||||
| } | |||||
| protected function loadCustomWorkerState(array $state) { | |||||
| $this->invoiceIssues = idx($state, 'invoiceIssues'); | |||||
| return $this; | |||||
| } | |||||
| } | } | ||||