3 final class DiffusionBuildableEngine
4 extends HarbormasterBuildableEngine
{
6 public function publishBuildable(
7 HarbormasterBuildable
$old,
8 HarbormasterBuildable
$new) {
10 // Don't publish manual buildables.
11 if ($new->getIsManualBuildable()) {
15 // Don't publish anything if the buildable status has not changed. At
16 // least for now, Diffusion handles buildable status exactly the same
17 // way that Harbormaster does.
18 $old_status = $old->getBuildableStatus();
19 $new_status = $new->getBuildableStatus();
20 if ($old_status === $new_status) {
24 // Don't publish anything if the buildable is still building.
25 if ($new->isBuilding()) {
29 $xaction = $this->newTransaction()
30 ->setMetadataValue('harbormaster:buildablePHID', $new->getPHID())
31 ->setTransactionType(DiffusionCommitBuildableTransaction
::TRANSACTIONTYPE
)
32 ->setNewValue($new->getBuildableStatus());
34 $this->applyTransactions(array($xaction));
37 public function getAuthorIdentity() {
38 return $this->getObject()
39 ->loadIdentities($this->getViewer())
40 ->getAuthorIdentity();