Path: blob/master/src/applications/people/query/PhabricatorPeopleLogQuery.php
12256 views
<?php12final class PhabricatorPeopleLogQuery3extends PhabricatorCursorPagedPolicyAwareQuery {45private $ids;6private $actorPHIDs;7private $userPHIDs;8private $relatedPHIDs;9private $sessionKeys;10private $actions;11private $remoteAddressPrefix;12private $dateCreatedMin;13private $dateCreatedMax;1415public function withIDs(array $ids) {16$this->ids = $ids;17return $this;18}1920public function withActorPHIDs(array $actor_phids) {21$this->actorPHIDs = $actor_phids;22return $this;23}2425public function withUserPHIDs(array $user_phids) {26$this->userPHIDs = $user_phids;27return $this;28}2930public function withRelatedPHIDs(array $related_phids) {31$this->relatedPHIDs = $related_phids;32return $this;33}3435public function withSessionKeys(array $session_keys) {36$this->sessionKeys = $session_keys;37return $this;38}3940public function withActions(array $actions) {41$this->actions = $actions;42return $this;43}4445public function withRemoteAddressPrefix($remote_address_prefix) {46$this->remoteAddressPrefix = $remote_address_prefix;47return $this;48}4950public function withDateCreatedBetween($min, $max) {51$this->dateCreatedMin = $min;52$this->dateCreatedMax = $max;53return $this;54}5556public function newResultObject() {57return new PhabricatorUserLog();58}5960protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {61$where = parent::buildWhereClauseParts($conn);6263if ($this->ids !== null) {64$where[] = qsprintf(65$conn,66'id IN (%Ld)',67$this->ids);68}6970if ($this->actorPHIDs !== null) {71$where[] = qsprintf(72$conn,73'actorPHID IN (%Ls)',74$this->actorPHIDs);75}7677if ($this->userPHIDs !== null) {78$where[] = qsprintf(79$conn,80'userPHID IN (%Ls)',81$this->userPHIDs);82}8384if ($this->relatedPHIDs !== null) {85$where[] = qsprintf(86$conn,87'(actorPHID IN (%Ls) OR userPHID IN (%Ls))',88$this->relatedPHIDs,89$this->relatedPHIDs);90}9192if ($this->sessionKeys !== null) {93$where[] = qsprintf(94$conn,95'session IN (%Ls)',96$this->sessionKeys);97}9899if ($this->actions !== null) {100$where[] = qsprintf(101$conn,102'action IN (%Ls)',103$this->actions);104}105106if ($this->remoteAddressPrefix !== null) {107$where[] = qsprintf(108$conn,109'remoteAddr LIKE %>',110$this->remoteAddressPrefix);111}112113if ($this->dateCreatedMin !== null) {114$where[] = qsprintf(115$conn,116'dateCreated >= %d',117$this->dateCreatedMin);118}119120if ($this->dateCreatedMax !== null) {121$where[] = qsprintf(122$conn,123'dateCreated <= %d',124$this->dateCreatedMax);125}126127return $where;128}129130public function getQueryApplicationClass() {131return 'PhabricatorPeopleApplication';132}133134}135136137