1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 02:02:41 +01:00

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
This commit is contained in:
epriestley 2021-03-16 11:14:26 -07:00
parent c3e6db6f0b
commit 9003a45369

View file

@ -49,8 +49,8 @@ final class AlmanacDevice
) + parent::getConfiguration(); ) + parent::getConfiguration();
} }
public function generatePHID() { public function getPHIDType() {
return PhabricatorPHID::generateNewPHID(AlmanacDevicePHIDType::TYPECONST); return AlmanacDevicePHIDType::TYPECONST;
} }
public function save() { public function save() {
@ -62,7 +62,9 @@ final class AlmanacDevice
} }
public function getURI() { public function getURI() {
return '/almanac/device/view/'.$this->getName().'/'; return urisprintf(
'/almanac/device/view/%s/',
$this->getName());
} }
public function rebuildClusterBindingStatus() { public function rebuildClusterBindingStatus() {
@ -84,8 +86,8 @@ final class AlmanacDevice
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
queryfx( queryfx(
$this->establishConnection('w'), $this->establishConnection('w'),
'UPDATE %T SET isBoundToClusterService = %d WHERE id = %d', 'UPDATE %R SET isBoundToClusterService = %d WHERE id = %d',
$this->getTableName(), $this,
$this->getIsBoundToClusterService(), $this->getIsBoundToClusterService(),
$this->getID()); $this->getID());
unset($unguarded); unset($unguarded);