Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/query/PhabricatorPeopleLogQuery.php
| <?php | <?php | ||||
| final class PhabricatorPeopleLogQuery | final class PhabricatorPeopleLogQuery | ||||
| extends PhabricatorCursorPagedPolicyAwareQuery { | extends PhabricatorCursorPagedPolicyAwareQuery { | ||||
| private $actorPHIDs; | private $actorPHIDs; | ||||
| private $userPHIDs; | private $userPHIDs; | ||||
| private $relatedPHIDs; | private $relatedPHIDs; | ||||
| private $sessionKeys; | private $sessionKeys; | ||||
| private $actions; | private $actions; | ||||
| private $remoteAddressPrefix; | private $remoteAddressPrefix; | ||||
| private $dateCreatedMin; | |||||
| private $dateCreatedMax; | |||||
| public function withActorPHIDs(array $actor_phids) { | public function withActorPHIDs(array $actor_phids) { | ||||
| $this->actorPHIDs = $actor_phids; | $this->actorPHIDs = $actor_phids; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withUserPHIDs(array $user_phids) { | public function withUserPHIDs(array $user_phids) { | ||||
| $this->userPHIDs = $user_phids; | $this->userPHIDs = $user_phids; | ||||
| Show All 15 Lines | public function withActions(array $actions) { | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withRemoteAddressPrefix($remote_address_prefix) { | public function withRemoteAddressPrefix($remote_address_prefix) { | ||||
| $this->remoteAddressPrefix = $remote_address_prefix; | $this->remoteAddressPrefix = $remote_address_prefix; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withDateCreatedBetween($min, $max) { | |||||
| $this->dateCreatedMin = $min; | |||||
| $this->dateCreatedMax = $max; | |||||
| return $this; | |||||
| } | |||||
| public function newResultObject() { | public function newResultObject() { | ||||
| return new PhabricatorUserLog(); | return new PhabricatorUserLog(); | ||||
| } | } | ||||
| protected function loadPage() { | protected function loadPage() { | ||||
| return $this->loadStandardPage($this->newResultObject()); | return $this->loadStandardPage($this->newResultObject()); | ||||
| } | } | ||||
| Show All 38 Lines | protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | ||||
| if ($this->remoteAddressPrefix !== null) { | if ($this->remoteAddressPrefix !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn, | $conn, | ||||
| 'remoteAddr LIKE %>', | 'remoteAddr LIKE %>', | ||||
| $this->remoteAddressPrefix); | $this->remoteAddressPrefix); | ||||
| } | } | ||||
| if ($this->dateCreatedMin !== null) { | |||||
| $where[] = qsprintf( | |||||
| $conn, | |||||
| 'dateCreated >= %d', | |||||
| $this->dateCreatedMin); | |||||
| } | |||||
| if ($this->dateCreatedMax !== null) { | |||||
| $where[] = qsprintf( | |||||
| $conn, | |||||
| 'dateCreated <= %d', | |||||
| $this->dateCreatedMax); | |||||
| } | |||||
| return $where; | return $where; | ||||
| } | } | ||||
| public function getQueryApplicationClass() { | public function getQueryApplicationClass() { | ||||
| return 'PhabricatorPeopleApplication'; | return 'PhabricatorPeopleApplication'; | ||||
| } | } | ||||
| } | } | ||||