Path: blob/master/src/applications/diffusion/harbormaster/DiffusionBuildableEngine.php
12241 views
<?php12final class DiffusionBuildableEngine3extends HarbormasterBuildableEngine {45public function publishBuildable(6HarbormasterBuildable $old,7HarbormasterBuildable $new) {89// Don't publish manual buildables.10if ($new->getIsManualBuildable()) {11return;12}1314// Don't publish anything if the buildable status has not changed. At15// least for now, Diffusion handles buildable status exactly the same16// way that Harbormaster does.17$old_status = $old->getBuildableStatus();18$new_status = $new->getBuildableStatus();19if ($old_status === $new_status) {20return;21}2223// Don't publish anything if the buildable is still building.24if ($new->isBuilding()) {25return;26}2728$xaction = $this->newTransaction()29->setMetadataValue('harbormaster:buildablePHID', $new->getPHID())30->setTransactionType(DiffusionCommitBuildableTransaction::TRANSACTIONTYPE)31->setNewValue($new->getBuildableStatus());3233$this->applyTransactions(array($xaction));34}3536public function getAuthorIdentity() {37return $this->getObject()38->loadIdentities($this->getViewer())39->getAuthorIdentity();40}4142}434445