1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 05:50:55 +01:00

Minor, fix insertNotifications() for unmigrated callsites. See discussion in rP3a6ee79190b709d84ff79865d1c1d6234e5c102a.

This commit is contained in:
epriestley 2012-06-08 19:15:42 -07:00
parent 284d7b6a46
commit 4d6df7dc14

View file

@ -104,11 +104,15 @@ final class PhabricatorFeedStoryPublisher {
private function insertNotifications($chrono_key) { private function insertNotifications($chrono_key) {
if (!$this->primaryObjectPHID) { if (!$this->subscribedPHIDs) {
throw return;
new Exception("Call setPrimaryObjectPHID() before Publishing!");
} }
if ($this->subscribedPHIDs) {
if (!$this->primaryObjectPHID) {
throw new Exception(
"You must call setPrimaryObjectPHID() if you setSubscribedPHIDs()!");
}
$notif = new PhabricatorFeedStoryNotification(); $notif = new PhabricatorFeedStoryNotification();
$sql = array(); $sql = array();
$conn = $notif->establishConnection('w'); $conn = $notif->establishConnection('w');
@ -132,7 +136,7 @@ final class PhabricatorFeedStoryPublisher {
implode(', ', $sql)); implode(', ', $sql));
} }
}
/** /**
* We generate a unique chronological key for each story type because we want * We generate a unique chronological key for each story type because we want
* to be able to page through the stream with a cursor (i.e., select stories * to be able to page through the stream with a cursor (i.e., select stories