From 9003a453691fdce5ab85a932e175c7c925e7225f Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 16 Mar 2021 11:14:26 -0700 Subject: [PATCH] Make minor Almanac device modernization updates Summary: Ref T13641. Provide minor modernizations before adding a "Disabled" state. Test Plan: Browsed devices, created a new device. Maniphest Tasks: T13641 Differential Revision: https://secure.phabricator.com/D21626 --- src/applications/almanac/storage/AlmanacDevice.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/applications/almanac/storage/AlmanacDevice.php b/src/applications/almanac/storage/AlmanacDevice.php index 8529285dc0..4910112f97 100644 --- a/src/applications/almanac/storage/AlmanacDevice.php +++ b/src/applications/almanac/storage/AlmanacDevice.php @@ -49,8 +49,8 @@ final class AlmanacDevice ) + parent::getConfiguration(); } - public function generatePHID() { - return PhabricatorPHID::generateNewPHID(AlmanacDevicePHIDType::TYPECONST); + public function getPHIDType() { + return AlmanacDevicePHIDType::TYPECONST; } public function save() { @@ -62,7 +62,9 @@ final class AlmanacDevice } public function getURI() { - return '/almanac/device/view/'.$this->getName().'/'; + return urisprintf( + '/almanac/device/view/%s/', + $this->getName()); } public function rebuildClusterBindingStatus() { @@ -84,8 +86,8 @@ final class AlmanacDevice $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); queryfx( $this->establishConnection('w'), - 'UPDATE %T SET isBoundToClusterService = %d WHERE id = %d', - $this->getTableName(), + 'UPDATE %R SET isBoundToClusterService = %d WHERE id = %d', + $this, $this->getIsBoundToClusterService(), $this->getID()); unset($unguarded); -- 2.51.2