Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/storage/DifferentialRevision.php
| Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | final class DifferentialRevision extends DifferentialDAO | ||||
| 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'; | const PROPERTY_DRAFT_HOLD = 'draft.hold'; | ||||
| const PROPERTY_HAS_BROADCAST = 'draft.broadcast'; | |||||
| 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 643 Lines • ▼ Show 20 Lines | /* -( PhabricatorTokenReceiverInterface )---------------------------------- */ | ||||
| public function getHoldAsDraft() { | public function getHoldAsDraft() { | ||||
| return $this->getProperty(self::PROPERTY_DRAFT_HOLD, false); | return $this->getProperty(self::PROPERTY_DRAFT_HOLD, false); | ||||
| } | } | ||||
| public function setHoldAsDraft($hold) { | public function setHoldAsDraft($hold) { | ||||
| return $this->setProperty(self::PROPERTY_DRAFT_HOLD, $hold); | return $this->setProperty(self::PROPERTY_DRAFT_HOLD, $hold); | ||||
| } | } | ||||
| public function getHasBroadcast() { | |||||
| return $this->getProperty(self::PROPERTY_HAS_BROADCAST, false); | |||||
| } | |||||
| public function setHasBroadcast($has_broadcast) { | |||||
| return $this->setProperty(self::PROPERTY_HAS_BROADCAST, $has_broadcast); | |||||
| } | |||||
| 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 309 Lines • Show Last 20 Lines | |||||