3 final class PhabricatorConduitLogQuery
4 extends PhabricatorCursorPagedPolicyAwareQuery
{
9 private $methodStatuses;
13 public function withIDs(array $ids) {
18 public function withCallerPHIDs(array $phids) {
19 $this->callerPHIDs
= $phids;
23 public function withMethods(array $methods) {
24 $this->methods
= $methods;
28 public function withMethodStatuses(array $statuses) {
29 $this->methodStatuses
= $statuses;
33 public function withEpochBetween($epoch_min, $epoch_max) {
34 $this->epochMin
= $epoch_min;
35 $this->epochMax
= $epoch_max;
39 public function newResultObject() {
40 return new PhabricatorConduitMethodCallLog();
43 protected function loadPage() {
44 return $this->loadStandardPage($this->newResultObject());
47 protected function buildWhereClauseParts(AphrontDatabaseConnection
$conn) {
48 $where = parent
::buildWhereClauseParts($conn);
50 if ($this->ids
!== null) {
57 if ($this->callerPHIDs
!== null) {
60 'callerPHID IN (%Ls)',
64 if ($this->methods
!== null) {
71 if ($this->methodStatuses
!== null) {
72 $statuses = array_fuse($this->methodStatuses
);
74 $methods = id(new PhabricatorConduitMethodQuery())
75 ->setViewer($this->getViewer())
78 $method_names = array();
79 foreach ($methods as $method) {
80 $status = $method->getMethodStatus();
81 if (isset($statuses[$status])) {
82 $method_names[] = $method->getAPIMethodName();
87 throw new PhabricatorEmptyQueryException();
96 if ($this->epochMin
!== null) {
103 if ($this->epochMax
!== null) {
113 public function getQueryApplicationClass() {
114 return 'PhabricatorConduitApplication';