Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/query/DiffusionPullLogSearchEngine.php
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | return array( | ||||
->setLabel(pht('Pullers')) | ->setLabel(pht('Pullers')) | ||||
->setDescription( | ->setDescription( | ||||
pht('Search for pull logs by specific users.')), | pht('Search for pull logs by specific users.')), | ||||
); | ); | ||||
} | } | ||||
protected function newExportFields() { | protected function newExportFields() { | ||||
return array( | return array( | ||||
id(new PhabricatorIDExportField()) | |||||
->setKey('id') | |||||
->setLabel(pht('ID')), | |||||
id(new PhabricatorPHIDExportField()) | |||||
->setKey('phid') | |||||
->setLabel(pht('PHID')), | |||||
id(new PhabricatorPHIDExportField()) | id(new PhabricatorPHIDExportField()) | ||||
->setKey('repositoryPHID') | ->setKey('repositoryPHID') | ||||
->setLabel(pht('Repository PHID')), | ->setLabel(pht('Repository PHID')), | ||||
id(new PhabricatorStringExportField()) | id(new PhabricatorStringExportField()) | ||||
->setKey('repository') | ->setKey('repository') | ||||
->setLabel(pht('Repository')), | ->setLabel(pht('Repository')), | ||||
id(new PhabricatorPHIDExportField()) | id(new PhabricatorPHIDExportField()) | ||||
->setKey('pullerPHID') | ->setKey('pullerPHID') | ||||
Show All 11 Lines | return array( | ||||
->setKey('code') | ->setKey('code') | ||||
->setLabel(pht('Code')), | ->setLabel(pht('Code')), | ||||
id(new PhabricatorEpochExportField()) | id(new PhabricatorEpochExportField()) | ||||
->setKey('date') | ->setKey('date') | ||||
->setLabel(pht('Date')), | ->setLabel(pht('Date')), | ||||
); | ); | ||||
} | } | ||||
public function newExport(array $events) { | protected function newExportData(array $events) { | ||||
$viewer = $this->requireViewer(); | $viewer = $this->requireViewer(); | ||||
$phids = array(); | $phids = array(); | ||||
foreach ($events as $event) { | foreach ($events as $event) { | ||||
if ($event->getPullerPHID()) { | if ($event->getPullerPHID()) { | ||||
$phids[] = $event->getPullerPHID(); | $phids[] = $event->getPullerPHID(); | ||||
} | } | ||||
} | } | ||||
Show All 13 Lines | foreach ($events as $event) { | ||||
$puller_phid = $event->getPullerPHID(); | $puller_phid = $event->getPullerPHID(); | ||||
if ($puller_phid) { | if ($puller_phid) { | ||||
$puller_name = $handles[$puller_phid]->getName(); | $puller_name = $handles[$puller_phid]->getName(); | ||||
} else { | } else { | ||||
$puller_name = null; | $puller_name = null; | ||||
} | } | ||||
$export[] = array( | $export[] = array( | ||||
'id' => $event->getID(), | |||||
'phid' => $event->getPHID(), | |||||
'repositoryPHID' => $repository_phid, | 'repositoryPHID' => $repository_phid, | ||||
'repository' => $repository_name, | 'repository' => $repository_name, | ||||
'pullerPHID' => $puller_phid, | 'pullerPHID' => $puller_phid, | ||||
'puller' => $puller_name, | 'puller' => $puller_name, | ||||
'protocol' => $event->getRemoteProtocol(), | 'protocol' => $event->getRemoteProtocol(), | ||||
'result' => $event->getResultType(), | 'result' => $event->getResultType(), | ||||
'code' => $event->getResultCode(), | 'code' => $event->getResultCode(), | ||||
'date' => $event->getEpoch(), | 'date' => $event->getEpoch(), | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |