Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13976308
D13762.id33239.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D13762.id33239.diff
View Options
diff --git a/src/applications/nuance/controller/NuanceItemEditController.php b/src/applications/nuance/controller/NuanceItemEditController.php
--- a/src/applications/nuance/controller/NuanceItemEditController.php
+++ b/src/applications/nuance/controller/NuanceItemEditController.php
@@ -2,33 +2,16 @@
final class NuanceItemEditController extends NuanceController {
- private $itemID;
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
- public function setItemID($item_id) {
- $this->itemID = $item_id;
- return $this;
- }
- public function getItemID() {
- return $this->itemID;
- }
-
- public function willProcessRequest(array $data) {
- $this->setItemID(idx($data, 'id'));
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
-
- $item_id = $this->getItemID();
- $is_new = !$item_id;
-
- if ($is_new) {
+ if (!$id) {
$item = new NuanceItem();
} else {
$item = id(new NuanceItemQuery())
- ->setViewer($user)
- ->withIDs(array($item_id))
+ ->setViewer($viewer)
+ ->withIDs(array($id))
->executeOne();
}
diff --git a/src/applications/nuance/controller/NuanceItemViewController.php b/src/applications/nuance/controller/NuanceItemViewController.php
--- a/src/applications/nuance/controller/NuanceItemViewController.php
+++ b/src/applications/nuance/controller/NuanceItemViewController.php
@@ -2,28 +2,13 @@
final class NuanceItemViewController extends NuanceController {
- private $itemID;
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
- public function setItemID($item_id) {
- $this->itemID = $item_id;
- return $this;
- }
- public function getItemID() {
- return $this->itemID;
- }
-
- public function willProcessRequest(array $data) {
- $this->setItemID($data['id']);
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
-
- $item_id = $this->getItemID();
$item = id(new NuanceItemQuery())
- ->setViewer($user)
- ->withIDs(array($item_id))
+ ->setViewer($viewer)
+ ->withIDs(array($id))
->executeOne();
if (!$item) {
diff --git a/src/applications/nuance/controller/NuanceRequestorEditController.php b/src/applications/nuance/controller/NuanceRequestorEditController.php
--- a/src/applications/nuance/controller/NuanceRequestorEditController.php
+++ b/src/applications/nuance/controller/NuanceRequestorEditController.php
@@ -2,34 +2,17 @@
final class NuanceRequestorEditController extends NuanceController {
- private $requestorID;
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
- public function setRequestorID($requestor_id) {
- $this->requestorID = $requestor_id;
- return $this;
- }
- public function getRequestorID() {
- return $this->requestorID;
- }
-
- public function willProcessRequest(array $data) {
- $this->setRequestorID(idx($data, 'id'));
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
-
- $requestor_id = $this->getRequestorID();
- $is_new = !$requestor_id;
-
- if ($is_new) {
+ if (!$id) {
$requestor = new NuanceRequestor();
} else {
$requestor = id(new NuanceRequestorQuery())
- ->setViewer($user)
- ->withIDs(array($requestor_id))
+ ->setViewer($viewer)
+ ->withIDs(array($id))
->executeOne();
}
diff --git a/src/applications/nuance/controller/NuanceRequestorViewController.php b/src/applications/nuance/controller/NuanceRequestorViewController.php
--- a/src/applications/nuance/controller/NuanceRequestorViewController.php
+++ b/src/applications/nuance/controller/NuanceRequestorViewController.php
@@ -2,28 +2,13 @@
final class NuanceRequestorViewController extends NuanceController {
- private $requestorID;
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
- public function setRequestorID($requestor_id) {
- $this->requestorID = $requestor_id;
- return $this;
- }
- public function getRequestorID() {
- return $this->requestorID;
- }
-
- public function willProcessRequest(array $data) {
- $this->setRequestorID($data['id']);
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
-
- $requestor_id = $this->getRequestorID();
$requestor = id(new NuanceRequestorQuery())
- ->setViewer($user)
- ->withIDs(array($requestor_id))
+ ->setViewer($viewer)
+ ->withIDs(array($id))
->executeOne();
if (!$requestor) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 19 2024, 1:41 PM (4 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6719173
Default Alt Text
D13762.id33239.diff (4 KB)
Attached To
Mode
D13762: Update Nuance for handleRequest
Attached
Detach File
Event Timeline
Log In to Comment