Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15372678
D19368.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D19368.diff
View Options
diff --git a/src/applications/almanac/query/AlmanacDeviceQuery.php b/src/applications/almanac/query/AlmanacDeviceQuery.php
--- a/src/applications/almanac/query/AlmanacDeviceQuery.php
+++ b/src/applications/almanac/query/AlmanacDeviceQuery.php
@@ -8,6 +8,7 @@
private $names;
private $namePrefix;
private $nameSuffix;
+ private $isClusterDevice;
public function withIDs(array $ids) {
$this->ids = $ids;
@@ -40,6 +41,11 @@
$ngrams);
}
+ public function withIsClusterDevice($is_cluster_device) {
+ $this->isClusterDevice = $is_cluster_device;
+ return $this;
+ }
+
public function newResultObject() {
return new AlmanacDevice();
}
@@ -90,6 +96,13 @@
$this->nameSuffix);
}
+ if ($this->isClusterDevice !== null) {
+ $where[] = qsprintf(
+ $conn,
+ 'device.isBoundToClusterService = %d',
+ (int)$this->isClusterDevice);
+ }
+
return $where;
}
diff --git a/src/applications/almanac/query/AlmanacDeviceSearchEngine.php b/src/applications/almanac/query/AlmanacDeviceSearchEngine.php
--- a/src/applications/almanac/query/AlmanacDeviceSearchEngine.php
+++ b/src/applications/almanac/query/AlmanacDeviceSearchEngine.php
@@ -25,6 +25,13 @@
->setLabel(pht('Exact Names'))
->setKey('names')
->setDescription(pht('Search for devices with specific names.')),
+ id(new PhabricatorSearchThreeStateField())
+ ->setLabel(pht('Cluster Device'))
+ ->setKey('isClusterDevice')
+ ->setOptions(
+ pht('Both Cluster and Non-cluster Devices'),
+ pht('Cluster Devices Only'),
+ pht('Non-cluster Devices Only')),
);
}
@@ -39,6 +46,10 @@
$query->withNames($map['names']);
}
+ if ($map['isClusterDevice'] !== null) {
+ $query->withIsClusterDevice($map['isClusterDevice']);
+ }
+
return $query;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 13, 1:38 PM (1 d, 47 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7578052
Default Alt Text
D19368.diff (1 KB)
Attached To
Mode
D19368: Add isClusterDevice to Almanac query
Attached
Detach File
Event Timeline
Log In to Comment