Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/storage/DifferentialRevision.php
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | final class DifferentialRevision extends DifferentialDAO | ||||
private $forceMap = array(); | private $forceMap = array(); | ||||
const TABLE_COMMIT = 'differential_commit'; | const TABLE_COMMIT = 'differential_commit'; | ||||
const RELATION_REVIEWER = 'revw'; | const RELATION_REVIEWER = 'revw'; | ||||
const RELATION_SUBSCRIBED = 'subd'; | const RELATION_SUBSCRIBED = 'subd'; | ||||
const PROPERTY_CLOSED_FROM_ACCEPTED = 'wasAcceptedBeforeClose'; | const PROPERTY_CLOSED_FROM_ACCEPTED = 'wasAcceptedBeforeClose'; | ||||
const PROPERTY_DRAFT_HOLD = 'draft.hold'; | |||||
public static function initializeNewRevision(PhabricatorUser $actor) { | public static function initializeNewRevision(PhabricatorUser $actor) { | ||||
$app = id(new PhabricatorApplicationQuery()) | $app = id(new PhabricatorApplicationQuery()) | ||||
->setViewer($actor) | ->setViewer($actor) | ||||
->withClasses(array('PhabricatorDifferentialApplication')) | ->withClasses(array('PhabricatorDifferentialApplication')) | ||||
->executeOne(); | ->executeOne(); | ||||
$view_policy = $app->getPolicy( | $view_policy = $app->getPolicy( | ||||
▲ Show 20 Lines • Show All 635 Lines • ▼ Show 20 Lines | /* -( PhabricatorTokenReceiverInterface )---------------------------------- */ | ||||
public function shouldBroadcast() { | public function shouldBroadcast() { | ||||
if (!$this->isDraft()) { | if (!$this->isDraft()) { | ||||
return true; | return true; | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
public function getHoldAsDraft() { | |||||
return $this->getProperty(self::PROPERTY_DRAFT_HOLD, false); | |||||
} | |||||
public function setHoldAsDraft($hold) { | |||||
amckinley: Unused argument.
Should be `return $this->setProperty(self::PROPERTY_DRAFT_HOLD, $hold);`? | |||||
return $this->setProperty(self::PROPERTY_DRAFT_HOLD, $hold); | |||||
} | |||||
public function loadActiveBuilds(PhabricatorUser $viewer) { | public function loadActiveBuilds(PhabricatorUser $viewer) { | ||||
$diff = $this->getActiveDiff(); | $diff = $this->getActiveDiff(); | ||||
$buildables = id(new HarbormasterBuildableQuery()) | $buildables = id(new HarbormasterBuildableQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withContainerPHIDs(array($this->getPHID())) | ->withContainerPHIDs(array($this->getPHID())) | ||||
->withBuildablePHIDs(array($diff->getPHID())) | ->withBuildablePHIDs(array($diff->getPHID())) | ||||
->withManualBuildables(false) | ->withManualBuildables(false) | ||||
▲ Show 20 Lines • Show All 294 Lines • Show Last 20 Lines |
Unused argument.
Should be return $this->setProperty(self::PROPERTY_DRAFT_HOLD, $hold);?