protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhabricatorEditEngineConfigurationTransaction::TYPE_NAME:
             $object->setName($xaction->getNewValue());
             return;
         case PhabricatorEditEngineConfigurationTransaction::TYPE_PREAMBLE:
             $object->setPreamble($xaction->getNewValue());
             return;
         case PhabricatorEditEngineConfigurationTransaction::TYPE_ORDER:
             $object->setFieldOrder($xaction->getNewValue());
             return;
         case PhabricatorEditEngineConfigurationTransaction::TYPE_DEFAULT:
             $field_key = $xaction->getMetadataValue('field.key');
             $object->setFieldDefault($field_key, $xaction->getNewValue());
             return;
         case PhabricatorEditEngineConfigurationTransaction::TYPE_LOCKS:
             $object->setFieldLocks($xaction->getNewValue());
             return;
         case PhabricatorEditEngineConfigurationTransaction::TYPE_DEFAULTCREATE:
             $object->setIsDefault($xaction->getNewValue());
             return;
         case PhabricatorEditEngineConfigurationTransaction::TYPE_DISABLE:
             $object->setIsDisabled($xaction->getNewValue());
             return;
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
Ejemplo n.º 2
0
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhameBlogTransaction::TYPE_NAME:
             return $object->setName($xaction->getNewValue());
         case PhameBlogTransaction::TYPE_SUBTITLE:
             return $object->setSubtitle($xaction->getNewValue());
         case PhameBlogTransaction::TYPE_DESCRIPTION:
             return $object->setDescription($xaction->getNewValue());
         case PhameBlogTransaction::TYPE_FULLDOMAIN:
             $new_value = $xaction->getNewValue();
             if (strlen($new_value)) {
                 $uri = new PhutilURI($new_value);
                 $domain = $uri->getDomain();
                 $object->setDomain($domain);
             } else {
                 $object->setDomain(null);
             }
             $object->setDomainFullURI($new_value);
             return;
         case PhameBlogTransaction::TYPE_PROFILEIMAGE:
             return $object->setProfileImagePHID($xaction->getNewValue());
         case PhameBlogTransaction::TYPE_HEADERIMAGE:
             return $object->setHeaderImagePHID($xaction->getNewValue());
         case PhameBlogTransaction::TYPE_STATUS:
             return $object->setStatus($xaction->getNewValue());
         case PhameBlogTransaction::TYPE_PARENTSITE:
             return $object->setParentSite($xaction->getNewValue());
         case PhameBlogTransaction::TYPE_PARENTDOMAIN:
             return $object->setParentDomain($xaction->getNewValue());
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhabricatorDashboardTransaction::TYPE_NAME:
             $object->setName($xaction->getNewValue());
             return;
         case PhabricatorDashboardTransaction::TYPE_STATUS:
             $object->setStatus($xaction->getNewValue());
             return;
         case PhabricatorDashboardTransaction::TYPE_LAYOUT_MODE:
             $old_layout = $object->getLayoutConfigObject();
             $new_layout = clone $old_layout;
             $new_layout->setLayoutMode($xaction->getNewValue());
             if ($old_layout->isMultiColumnLayout() != $new_layout->isMultiColumnLayout()) {
                 $panel_phids = $object->getPanelPHIDs();
                 $new_locations = $new_layout->getDefaultPanelLocations();
                 foreach ($panel_phids as $panel_phid) {
                     $new_locations[0][] = $panel_phid;
                 }
                 $new_layout->setPanelLocations($new_locations);
             }
             $object->setLayoutConfigFromObject($new_layout);
             return;
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PonderAnswerTransaction::TYPE_CONTENT:
             $object->setContent($xaction->getNewValue());
             break;
         case PonderAnswerTransaction::TYPE_QUESTION_ID:
             $object->setQuestionID($xaction->getNewValue());
             break;
     }
 }
Ejemplo n.º 5
0
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case NuanceSourceTransaction::TYPE_NAME:
             $object->setName($xaction->getNewValue());
             break;
         case NuanceSourceTransaction::TYPE_DEFAULT_QUEUE:
             $object->setDefaultQueuePHID($xaction->getNewValue());
             break;
     }
 }
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhabricatorDashboardPanelTransaction::TYPE_NAME:
             $object->setName($xaction->getNewValue());
             return;
         case PhabricatorDashboardPanelTransaction::TYPE_ARCHIVE:
             $object->setIsArchived((int) $xaction->getNewValue());
             return;
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
Ejemplo n.º 7
0
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhluxTransaction::TYPE_EDIT_KEY:
             $object->setVariableKey($xaction->getNewValue());
             return;
         case PhluxTransaction::TYPE_EDIT_VALUE:
             $object->setVariableValue($xaction->getNewValue());
             return;
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
Ejemplo n.º 8
0
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case AlmanacServiceTransaction::TYPE_NAME:
             $object->setName($xaction->getNewValue());
             return;
         case AlmanacServiceTransaction::TYPE_LOCK:
             $object->setIsLocked((int) $xaction->getNewValue());
             return;
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhortuneMerchantTransaction::TYPE_NAME:
             $object->setName($xaction->getNewValue());
             return;
         case PhortuneMerchantTransaction::TYPE_DESCRIPTION:
             $object->setDescription($xaction->getNewValue());
             return;
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
Ejemplo n.º 10
0
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case DrydockBlueprintTransaction::TYPE_NAME:
             $object->setBlueprintName($xaction->getNewValue());
             return;
         case DrydockBlueprintTransaction::TYPE_DISABLED:
             $object->setIsDisabled((int) $xaction->getNewValue());
             return;
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case HarbormasterBuildPlanTransaction::TYPE_NAME:
             $object->setName($xaction->getNewValue());
             return;
         case HarbormasterBuildPlanTransaction::TYPE_STATUS:
             $object->setPlanStatus($xaction->getNewValue());
             return;
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
Ejemplo n.º 12
0
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case NuanceItemTransaction::TYPE_REQUESTOR:
             $object->setRequestorPHID($xaction->getNewValue());
             break;
         case NuanceItemTransaction::TYPE_SOURCE:
             $object->setSourcePHID($xaction->getNewValue());
             break;
         case NuanceItemTransaction::TYPE_OWNER:
             $object->setOwnerPHID($xaction->getNewValue());
             break;
     }
 }
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhortunePaymentProviderConfigTransaction::TYPE_CREATE:
             return;
         case PhortunePaymentProviderConfigTransaction::TYPE_PROPERTY:
             $property_key = $xaction->getMetadataValue(PhortunePaymentProviderConfigTransaction::PROPERTY_KEY);
             $object->setMetadataValue($property_key, $xaction->getNewValue());
             return;
         case PhortunePaymentProviderConfigTransaction::TYPE_ENABLE:
             return $object->setIsEnabled((int) $xaction->getNewValue());
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case HarbormasterBuildStepTransaction::TYPE_CREATE:
             return;
         case HarbormasterBuildStepTransaction::TYPE_NAME:
             return $object->setName($xaction->getNewValue());
         case HarbormasterBuildStepTransaction::TYPE_DEPENDS_ON:
             return $object->setDetail('dependsOn', $xaction->getNewValue());
         case HarbormasterBuildStepTransaction::TYPE_DESCRIPTION:
             return $object->setDescription($xaction->getNewValue());
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
Ejemplo n.º 15
0
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhamePostTransaction::TYPE_TITLE:
             return $object->setTitle($xaction->getNewValue());
         case PhamePostTransaction::TYPE_PHAME_TITLE:
             return $object->setPhameTitle($xaction->getNewValue());
         case PhamePostTransaction::TYPE_BODY:
             return $object->setBody($xaction->getNewValue());
         case PhamePostTransaction::TYPE_COMMENTS_WIDGET:
             return $object->setCommentsWidget($xaction->getNewValue());
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
Ejemplo n.º 16
0
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhamePostTransaction::TYPE_TITLE:
             return $object->setTitle($xaction->getNewValue());
         case PhamePostTransaction::TYPE_SUBTITLE:
             return $object->setSubtitle($xaction->getNewValue());
         case PhamePostTransaction::TYPE_BODY:
             return $object->setBody($xaction->getNewValue());
         case PhamePostTransaction::TYPE_BLOG:
             return $object->setBlogPHID($xaction->getNewValue());
         case PhamePostTransaction::TYPE_HEADERIMAGE:
             return $object->setHeaderImagePHID($xaction->getNewValue());
         case PhamePostTransaction::TYPE_VISIBILITY:
             if ($xaction->getNewValue() == PhameConstants::VISIBILITY_DRAFT) {
                 $object->setDatePublished(0);
             } else {
                 if ($xaction->getNewValue() == PhameConstants::VISIBILITY_ARCHIVED) {
                     $object->setDatePublished(0);
                 } else {
                     $object->setDatePublished(PhabricatorTime::getNow());
                 }
             }
             return $object->setVisibility($xaction->getNewValue());
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
Ejemplo n.º 17
0
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhameBlogTransaction::TYPE_NAME:
             return $object->setName($xaction->getNewValue());
         case PhameBlogTransaction::TYPE_DESCRIPTION:
             return $object->setDescription($xaction->getNewValue());
         case PhameBlogTransaction::TYPE_DOMAIN:
             return $object->setDomain($xaction->getNewValue());
         case PhameBlogTransaction::TYPE_STATUS:
             return $object->setStatus($xaction->getNewValue());
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhabricatorOAuthServerTransaction::TYPE_NAME:
             $object->setName($xaction->getNewValue());
             return;
         case PhabricatorOAuthServerTransaction::TYPE_REDIRECT_URI:
             $object->setRedirectURI($xaction->getNewValue());
             return;
         case PhabricatorOAuthServerTransaction::TYPE_DISABLED:
             $object->setIsDisabled($xaction->getNewValue());
             return;
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhabricatorProjectColumnTransaction::TYPE_NAME:
             $object->setName($xaction->getNewValue());
             return;
         case PhabricatorProjectColumnTransaction::TYPE_STATUS:
             $object->setStatus($xaction->getNewValue());
             return;
         case PhabricatorProjectColumnTransaction::TYPE_LIMIT:
             $object->setPointLimit($xaction->getNewValue());
             return;
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
Ejemplo n.º 20
0
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhortuneProductTransaction::TYPE_NAME:
             $object->setProductName($xaction->getNewValue());
             return;
         case PhortuneProductTransaction::TYPE_TYPE:
             $object->setProductType($xaction->getNewValue());
             return;
         case PhortuneProductTransaction::TYPE_PRICE:
             $object->setPriceInCents($xaction->getNewValue());
             return;
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PassphraseCredentialTransaction::TYPE_NAME:
             $object->setName($xaction->getNewValue());
             return;
         case PassphraseCredentialTransaction::TYPE_DESCRIPTION:
             $object->setDescription($xaction->getNewValue());
             return;
         case PassphraseCredentialTransaction::TYPE_USERNAME:
             $object->setUsername($xaction->getNewValue());
             return;
         case PassphraseCredentialTransaction::TYPE_SECRET_ID:
             $old_id = $object->getSecretID();
             if ($old_id) {
                 $this->destroySecret($old_id);
             }
             $object->setSecretID($xaction->getNewValue());
             return;
         case PassphraseCredentialTransaction::TYPE_DESTROY:
             // When destroying a credential, wipe out its secret.
             $is_destroyed = $xaction->getNewValue();
             $object->setIsDestroyed($is_destroyed);
             if ($is_destroyed) {
                 $secret_id = $object->getSecretID();
                 if ($secret_id) {
                     $this->destroySecret($secret_id);
                     $object->setSecretID(null);
                 }
             }
             return;
         case PhabricatorTransactions::TYPE_VIEW_POLICY:
             $object->setViewPolicy($xaction->getNewValue());
             return;
         case PhabricatorTransactions::TYPE_EDIT_POLICY:
             $object->setEditPolicy($xaction->getNewValue());
             return;
         case PassphraseCredentialTransaction::TYPE_LOOKEDATSECRET:
             return;
         case PassphraseCredentialTransaction::TYPE_LOCK:
             $object->setIsLocked((int) $xaction->getNewValue());
             return;
         case PassphraseCredentialTransaction::TYPE_CONDUIT:
             $object->setAllowConduit((int) $xaction->getNewValue());
             return;
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
Ejemplo n.º 22
0
 protected function applyCustomExternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhabricatorMacroTransaction::TYPE_FILE:
         case PhabricatorMacroTransaction::TYPE_AUDIO:
             // When changing a macro's image or audio, attach the underlying files
             // to the macro (and detach the old files).
             $old = $xaction->getOldValue();
             $new = $xaction->getNewValue();
             $all = array();
             if ($old) {
                 $all[] = $old;
             }
             if ($new) {
                 $all[] = $new;
             }
             $files = id(new PhabricatorFileQuery())->setViewer($this->requireActor())->withPHIDs($all)->execute();
             $files = mpull($files, null, 'getPHID');
             $old_file = idx($files, $old);
             if ($old_file) {
                 $old_file->detachFromObject($object->getPHID());
             }
             $new_file = idx($files, $new);
             if ($new_file) {
                 $new_file->attachToObject($object->getPHID());
             }
             break;
     }
 }
Ejemplo n.º 23
0
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case HeraldRuleTransaction::TYPE_DISABLE:
             return $object->setIsDisabled($xaction->getNewValue());
         case HeraldRuleTransaction::TYPE_NAME:
             return $object->setName($xaction->getNewValue());
         case HeraldRuleTransaction::TYPE_EDIT:
             $new_state = id(new HeraldRuleSerializer())->deserializeRuleComponents($xaction->getNewValue());
             $object->setMustMatchAll((int) $new_state['match_all']);
             $object->attachConditions($new_state['conditions']);
             $object->attachActions($new_state['actions']);
             $object->setRepetitionPolicy(HeraldRepetitionPolicyConfig::toInt($new_state['repetition_policy']));
             return $object;
     }
 }
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     $value = $xaction->getNewValue();
     switch ($xaction->getTransactionType()) {
         case PhabricatorAuthSSHKeyTransaction::TYPE_NAME:
             $object->setName($value);
             return;
         case PhabricatorAuthSSHKeyTransaction::TYPE_KEY:
             $public_key = PhabricatorAuthSSHPublicKey::newFromRawKey($value);
             $type = $public_key->getType();
             $body = $public_key->getBody();
             $comment = $public_key->getComment();
             $object->setKeyType($type);
             $object->setKeyBody($body);
             $object->setKeyComment($comment);
             return;
         case PhabricatorAuthSSHKeyTransaction::TYPE_DEACTIVATE:
             if ($value) {
                 $new = null;
             } else {
                 $new = 1;
             }
             $object->setIsActive($new);
             return;
     }
 }
Ejemplo n.º 25
0
 protected function applyCustomExternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case AlmanacDeviceTransaction::TYPE_NAME:
             return;
         case AlmanacDeviceTransaction::TYPE_INTERFACE:
             $old = $xaction->getOldValue();
             if ($old) {
                 $interface = id(new AlmanacInterfaceQuery())->setViewer($this->requireActor())->withIDs(array($old['id']))->executeOne();
                 if (!$interface) {
                     throw new Exception(pht('Unable to load interface!'));
                 }
             } else {
                 $interface = AlmanacInterface::initializeNewInterface()->setDevicePHID($object->getPHID());
             }
             $new = $xaction->getNewValue();
             if ($new) {
                 $interface->setNetworkPHID($new['networkPHID'])->setAddress($new['address'])->setPort((int) $new['port']);
                 if (idx($new, 'phid')) {
                     $interface->setPHID($new['phid']);
                 }
                 $interface->save();
             } else {
                 $interface->delete();
             }
             return;
     }
     return parent::applyCustomExternalTransaction($object, $xaction);
 }
Ejemplo n.º 26
0
 protected function applyCustomExternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case PhabricatorTransactions::TYPE_COMMENT:
         case PhabricatorTransactions::TYPE_SUBSCRIBERS:
         case PhabricatorTransactions::TYPE_EDGE:
         case PhabricatorAuditActionConstants::ACTION:
         case PhabricatorAuditActionConstants::INLINE:
             return;
         case PhabricatorAuditActionConstants::ADD_AUDITORS:
             $new = $xaction->getNewValue();
             if (!is_array($new)) {
                 $new = array();
             }
             $old = $xaction->getOldValue();
             if (!is_array($old)) {
                 $old = array();
             }
             $add = array_diff_key($new, $old);
             $actor = $this->requireActor();
             $requests = $object->getAudits();
             $requests = mpull($requests, null, 'getAuditorPHID');
             foreach ($add as $phid) {
                 if (isset($requests[$phid])) {
                     continue;
                 }
                 $audit_requested = PhabricatorAuditStatusConstants::AUDIT_REQUESTED;
                 $requests[] = id(new PhabricatorRepositoryAuditRequest())->setCommitPHID($object->getPHID())->setAuditorPHID($phid)->setAuditStatus($audit_requested)->setAuditReasons(array('Added by ' . $actor->getUsername()))->save();
             }
             $object->attachAudits($requests);
             return;
     }
     return parent::applyCustomExternalTransaction($object, $xaction);
 }
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     $new = $xaction->getNewValue();
     switch ($xaction->getTransactionType()) {
         case ReleephRequestTransaction::TYPE_REQUEST:
             $object->setRequestCommitPHID($new);
             break;
         case ReleephRequestTransaction::TYPE_USER_INTENT:
             $user_phid = $xaction->getAuthorPHID();
             $intents = $object->getUserIntents();
             $intents[$user_phid] = $new;
             $object->setUserIntents($intents);
             break;
         case ReleephRequestTransaction::TYPE_EDIT_FIELD:
             $field = newv($xaction->getMetadataValue('fieldClass'), array());
             $field->setReleephRequest($object)->setValue($new);
             break;
         case ReleephRequestTransaction::TYPE_PICK_STATUS:
             $object->setPickStatus($new);
             break;
         case ReleephRequestTransaction::TYPE_COMMIT:
             $this->setInBranchFromAction($object, $xaction);
             $object->setCommitIdentifier($new);
             break;
         case ReleephRequestTransaction::TYPE_DISCOVERY:
             $this->setInBranchFromAction($object, $xaction);
             $object->setCommitPHID($new);
             break;
         case ReleephRequestTransaction::TYPE_MANUAL_IN_BRANCH:
             $object->setInBranch((int) $new);
             break;
     }
 }
Ejemplo n.º 28
0
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case HeraldRuleTransaction::TYPE_DISABLE:
             return $object->setIsDisabled($xaction->getNewValue());
     }
 }
 protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     $type = $xaction->getTransactionType();
     switch ($type) {
         case PhabricatorCountdownTransaction::TYPE_TITLE:
             $object->setTitle($xaction->getNewValue());
             return;
         case PhabricatorCountdownTransaction::TYPE_DESCRIPTION:
             $object->setDescription($xaction->getNewValue());
             return;
         case PhabricatorCountdownTransaction::TYPE_EPOCH:
             $object->setEpoch($xaction->getNewValue());
             return;
     }
     return parent::applyCustomInternalTransaction($object, $xaction);
 }
Ejemplo n.º 30
0
 protected function applyCustomExternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
 {
     switch ($xaction->getTransactionType()) {
         case AlmanacBindingTransaction::TYPE_DISABLE:
             return;
         case AlmanacBindingTransaction::TYPE_INTERFACE:
             $interface_phids = array();
             $interface_phids[] = $xaction->getOldValue();
             $interface_phids[] = $xaction->getNewValue();
             $interface_phids = array_filter($interface_phids);
             $interface_phids = array_unique($interface_phids);
             $interfaces = id(new AlmanacInterfaceQuery())->setViewer(PhabricatorUser::getOmnipotentUser())->withPHIDs($interface_phids)->execute();
             $device_phids = array();
             foreach ($interfaces as $interface) {
                 $device_phids[] = $interface->getDevicePHID();
             }
             $device_phids = array_unique($device_phids);
             $devices = id(new AlmanacDeviceQuery())->setViewer(PhabricatorUser::getOmnipotentUser())->withPHIDs($device_phids)->execute();
             foreach ($devices as $device) {
                 $device->rebuildClusterBindingStatus();
             }
             return;
     }
     return parent::applyCustomExternalTransaction($object, $xaction);
 }