Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/storage/HarbormasterBuildable.php
| Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | $buildable = id(new HarbormasterBuildableQuery()) | ||||
| ->setViewer($actor) | ->setViewer($actor) | ||||
| ->withBuildablePHIDs(array($buildable_object_phid)) | ->withBuildablePHIDs(array($buildable_object_phid)) | ||||
| ->withManualBuildables(false) | ->withManualBuildables(false) | ||||
| ->setLimit(1) | ->setLimit(1) | ||||
| ->executeOne(); | ->executeOne(); | ||||
| if ($buildable) { | if ($buildable) { | ||||
| return $buildable; | return $buildable; | ||||
| } | } | ||||
| $buildable = HarbormasterBuildable::initializeNewBuildable($actor) | $buildable = self::initializeNewBuildable($actor) | ||||
| ->setBuildablePHID($buildable_object_phid) | ->setBuildablePHID($buildable_object_phid) | ||||
| ->setContainerPHID($container_object_phid); | ->setContainerPHID($container_object_phid); | ||||
| $buildable->save(); | $buildable->save(); | ||||
| return $buildable; | return $buildable; | ||||
| } | } | ||||
| /** | /** | ||||
| * Looks up the plan PHIDs and applies the plans to the specified | * Looks up the plan PHIDs and applies the plans to the specified | ||||
| Show All 11 Lines | public static function applyBuildPlans( | ||||
| // Skip all of this logic if the Harbormaster application | // Skip all of this logic if the Harbormaster application | ||||
| // isn't currently installed. | // isn't currently installed. | ||||
| $harbormaster_app = 'PhabricatorHarbormasterApplication'; | $harbormaster_app = 'PhabricatorHarbormasterApplication'; | ||||
| if (!PhabricatorApplication::isClassInstalled($harbormaster_app)) { | if (!PhabricatorApplication::isClassInstalled($harbormaster_app)) { | ||||
| return; | return; | ||||
| } | } | ||||
| $buildable = HarbormasterBuildable::createOrLoadExisting( | $buildable = self::createOrLoadExisting( | ||||
| PhabricatorUser::getOmnipotentUser(), | PhabricatorUser::getOmnipotentUser(), | ||||
| $phid, | $phid, | ||||
| $container_phid); | $container_phid); | ||||
| $plans = id(new HarbormasterBuildPlanQuery()) | $plans = id(new HarbormasterBuildPlanQuery()) | ||||
| ->setViewer(PhabricatorUser::getOmnipotentUser()) | ->setViewer(PhabricatorUser::getOmnipotentUser()) | ||||
| ->withPHIDs($plan_phids) | ->withPHIDs($plan_phids) | ||||
| ->execute(); | ->execute(); | ||||
| ▲ Show 20 Lines • Show All 175 Lines • Show Last 20 Lines | |||||