From 3b5a7d1c88c4bb297de68e694641c3da8a94a5e9 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 3 Apr 2018 08:09:02 -0700 Subject: [PATCH] Rename the Differential "hasBroadcast" flag to "shouldBroadcast" Summary: Depends on D19282. Ref T13110. I want to introduce "Changes Planned + Still A Draft" and "Abandoned + Still A Draft" states, at a minimum. I think the "hasBroadcast" flag is effectively identical to a hypothetical "stillADraft" flag, so rename it to "shouldBroadcast" to better match its intended behavior. This just changes labels, not any behavior. Test Plan: Grepped for `hasBroadcast` and `HAS_BROADCAST`. Maniphest Tasks: T13110 Differential Revision: https://secure.phabricator.com/D19283 --- .../editor/DifferentialTransactionEditor.php | 4 ++-- .../differential/storage/DifferentialRevision.php | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/applications/differential/editor/DifferentialTransactionEditor.php b/src/applications/differential/editor/DifferentialTransactionEditor.php index ccd83892db..4c9b29c2ed 100644 --- a/src/applications/differential/editor/DifferentialTransactionEditor.php +++ b/src/applications/differential/editor/DifferentialTransactionEditor.php @@ -1597,13 +1597,13 @@ final class DifferentialTransactionEditor $was_draft = $this->wasDraft; if (!$object->isDraft() && ($was_draft || $is_new)) { - if (!$object->getHasBroadcast()) { + if (!$object->getShouldBroadcast()) { // Mark this as the first broadcast we're sending about the revision // so mail can generate specially. $this->firstBroadcast = true; $object - ->setHasBroadcast(true) + ->setShouldBroadcast(true) ->save(); } } diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php index 05b82ed089..73d8def6d7 100644 --- a/src/applications/differential/storage/DifferentialRevision.php +++ b/src/applications/differential/storage/DifferentialRevision.php @@ -59,7 +59,7 @@ final class DifferentialRevision extends DifferentialDAO const PROPERTY_CLOSED_FROM_ACCEPTED = 'wasAcceptedBeforeClose'; const PROPERTY_DRAFT_HOLD = 'draft.hold'; - const PROPERTY_HAS_BROADCAST = 'draft.broadcast'; + const PROPERTY_SHOULD_BROADCAST = 'draft.broadcast'; const PROPERTY_LINES_ADDED = 'lines.added'; const PROPERTY_LINES_REMOVED = 'lines.removed'; const PROPERTY_BUILDABLES = 'buildables'; @@ -717,12 +717,14 @@ final class DifferentialRevision extends DifferentialDAO return $this->setProperty(self::PROPERTY_DRAFT_HOLD, $hold); } - public function getHasBroadcast() { - return $this->getProperty(self::PROPERTY_HAS_BROADCAST, false); + public function getShouldBroadcast() { + return $this->getProperty(self::PROPERTY_SHOULD_BROADCAST, false); } - public function setHasBroadcast($has_broadcast) { - return $this->setProperty(self::PROPERTY_HAS_BROADCAST, $has_broadcast); + public function setShouldBroadcast($should_broadcast) { + return $this->setProperty( + self::PROPERTY_SHOULD_BROADCAST, + $should_broadcast); } public function setAddedLineCount($count) {