Page MenuHomePhorge

DiffusionPreCommitContentAuthorProjectsHeraldField.php
No OneTemporary

Size
862 B
Referenced Files
None
Subscribers
None

DiffusionPreCommitContentAuthorProjectsHeraldField.php

<?php
final class DiffusionPreCommitContentAuthorProjectsHeraldField
extends DiffusionPreCommitContentHeraldField {
const FIELDCONST = 'diffusion.pre.commit.author.projects';
public function getHeraldFieldName() {
return pht("Author's projects");
}
public function getHeraldFieldValue($object) {
$adapter = $this->getAdapter();
$viewer = $adapter->getViewer();
$author_phid = $adapter->getAuthorPHID();
if (!$author_phid) {
return array();
}
$projects = id(new PhabricatorProjectQuery())
->setViewer($viewer)
->withMemberPHIDs(array($author_phid))
->execute();
return mpull($projects, 'getPHID');
}
protected function getHeraldFieldStandardType() {
return self::STANDARD_PHID_LIST;
}
protected function getDatasource() {
return new PhabricatorProjectDatasource();
}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, May 12, 1:27 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
121676
Default Alt Text
DiffusionPreCommitContentAuthorProjectsHeraldField.php (862 B)

Event Timeline