mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 04:50:55 +01:00
Introduce DrydockQuery to slightly reduce code duplication
Summary: Ref T2015. All the Drydock query classes share the application method; move it into a shared base class to slightly shrink the codebase. Test Plan: Browsed query UIs. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2015 Differential Revision: https://secure.phabricator.com/D7837
This commit is contained in:
parent
9b0fa5747b
commit
1ba52fac86
6 changed files with 20 additions and 27 deletions
|
@ -676,6 +676,7 @@ phutil_register_library_map(array(
|
|||
'DrydockPHIDTypeLease' => 'applications/drydock/phid/DrydockPHIDTypeLease.php',
|
||||
'DrydockPHIDTypeResource' => 'applications/drydock/phid/DrydockPHIDTypeResource.php',
|
||||
'DrydockPreallocatedHostBlueprintImplementation' => 'applications/drydock/blueprint/DrydockPreallocatedHostBlueprintImplementation.php',
|
||||
'DrydockQuery' => 'applications/drydock/query/DrydockQuery.php',
|
||||
'DrydockResource' => 'applications/drydock/storage/DrydockResource.php',
|
||||
'DrydockResourceCloseController' => 'applications/drydock/controller/DrydockResourceCloseController.php',
|
||||
'DrydockResourceController' => 'applications/drydock/controller/DrydockResourceController.php',
|
||||
|
@ -3055,7 +3056,7 @@ phutil_register_library_map(array(
|
|||
0 => 'DrydockBlueprintController',
|
||||
1 => 'PhabricatorApplicationSearchResultsControllerInterface',
|
||||
),
|
||||
'DrydockBlueprintQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'DrydockBlueprintQuery' => 'DrydockQuery',
|
||||
'DrydockBlueprintSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'DrydockBlueprintViewController' => 'DrydockBlueprintController',
|
||||
'DrydockCommandInterface' => 'DrydockInterface',
|
||||
|
@ -3074,7 +3075,7 @@ phutil_register_library_map(array(
|
|||
0 => 'DrydockLeaseController',
|
||||
1 => 'PhabricatorApplicationSearchResultsControllerInterface',
|
||||
),
|
||||
'DrydockLeaseQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'DrydockLeaseQuery' => 'DrydockQuery',
|
||||
'DrydockLeaseReleaseController' => 'DrydockLeaseController',
|
||||
'DrydockLeaseSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'DrydockLeaseStatus' => 'DrydockConstants',
|
||||
|
@ -3092,7 +3093,7 @@ phutil_register_library_map(array(
|
|||
0 => 'DrydockLogController',
|
||||
1 => 'PhabricatorApplicationSearchResultsControllerInterface',
|
||||
),
|
||||
'DrydockLogQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'DrydockLogQuery' => 'DrydockQuery',
|
||||
'DrydockLogSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'DrydockManagementCloseWorkflow' => 'DrydockManagementWorkflow',
|
||||
'DrydockManagementCreateResourceWorkflow' => 'DrydockManagementWorkflow',
|
||||
|
@ -3103,6 +3104,7 @@ phutil_register_library_map(array(
|
|||
'DrydockPHIDTypeLease' => 'PhabricatorPHIDType',
|
||||
'DrydockPHIDTypeResource' => 'PhabricatorPHIDType',
|
||||
'DrydockPreallocatedHostBlueprintImplementation' => 'DrydockBlueprintImplementation',
|
||||
'DrydockQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'DrydockResource' =>
|
||||
array(
|
||||
0 => 'DrydockDAO',
|
||||
|
@ -3115,7 +3117,7 @@ phutil_register_library_map(array(
|
|||
0 => 'DrydockResourceController',
|
||||
1 => 'PhabricatorApplicationSearchResultsControllerInterface',
|
||||
),
|
||||
'DrydockResourceQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'DrydockResourceQuery' => 'DrydockQuery',
|
||||
'DrydockResourceSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'DrydockResourceStatus' => 'DrydockConstants',
|
||||
'DrydockResourceViewController' => 'DrydockResourceController',
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
|
||||
final class DrydockBlueprintQuery
|
||||
extends PhabricatorCursorPagedPolicyAwareQuery {
|
||||
final class DrydockBlueprintQuery extends DrydockQuery {
|
||||
|
||||
private $ids;
|
||||
private $phids;
|
||||
|
@ -63,8 +62,4 @@ final class DrydockBlueprintQuery
|
|||
return $this->formatWhereClause($where);
|
||||
}
|
||||
|
||||
public function getQueryApplicationClass() {
|
||||
return 'PhabricatorApplicationDrydock';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
|
||||
final class DrydockLeaseQuery
|
||||
extends PhabricatorCursorPagedPolicyAwareQuery {
|
||||
final class DrydockLeaseQuery extends DrydockQuery {
|
||||
|
||||
private $ids;
|
||||
private $phids;
|
||||
|
@ -106,8 +105,4 @@ final class DrydockLeaseQuery
|
|||
return $this->formatWhereClause($where);
|
||||
}
|
||||
|
||||
public function getQueryApplicationClass() {
|
||||
return 'PhabricatorApplicationDrydock';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
final class DrydockLogQuery extends PhabricatorCursorPagedPolicyAwareQuery {
|
||||
final class DrydockLogQuery extends DrydockQuery {
|
||||
|
||||
private $resourceIDs;
|
||||
private $leaseIDs;
|
||||
|
@ -110,8 +110,4 @@ final class DrydockLogQuery extends PhabricatorCursorPagedPolicyAwareQuery {
|
|||
return $this->formatWhereClause($where);
|
||||
}
|
||||
|
||||
public function getQueryApplicationClass() {
|
||||
return 'PhabricatorApplicationDrydock';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
10
src/applications/drydock/query/DrydockQuery.php
Normal file
10
src/applications/drydock/query/DrydockQuery.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
abstract class DrydockQuery
|
||||
extends PhabricatorCursorPagedPolicyAwareQuery {
|
||||
|
||||
public function getQueryApplicationClass() {
|
||||
return 'PhabricatorApplicationDrydock';
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
|
||||
final class DrydockResourceQuery
|
||||
extends PhabricatorCursorPagedPolicyAwareQuery {
|
||||
final class DrydockResourceQuery extends DrydockQuery {
|
||||
|
||||
private $ids;
|
||||
private $phids;
|
||||
|
@ -94,8 +93,4 @@ final class DrydockResourceQuery
|
|||
return $this->formatWhereClause($where);
|
||||
}
|
||||
|
||||
public function getQueryApplicationClass() {
|
||||
return 'PhabricatorApplicationDrydock';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue