Select the types of activity you want to include in your feed.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
···11+<?php
22+33+/*
44+ * Copyright 2011 Facebook, Inc.
55+ *
66+ * Licensed under the Apache License, Version 2.0 (the "License");
77+ * you may not use this file except in compliance with the License.
88+ * You may obtain a copy of the License at
99+ *
1010+ * http://www.apache.org/licenses/LICENSE-2.0
1111+ *
1212+ * Unless required by applicable law or agreed to in writing, software
1313+ * distributed under the License is distributed on an "AS IS" BASIS,
1414+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1515+ * See the License for the specific language governing permissions and
1616+ * limitations under the License.
1717+ */
1818+1919+class ConduitAPI_differential_updatetaskrevisionassoc_Method
2020+ extends ConduitAPIMethod {
2121+ public function getMethodDescription() {
2222+ return "Given a task together with its original and new associated ".
2323+ "revisions, update the revisions for their attached_tasks.";
2424+ }
2525+2626+ public function defineParamTypes() {
2727+ return array(
2828+ 'task_phid' => 'required nonempty string',
2929+ 'orig_rev_phids' => 'required list<string>',
3030+ 'new_rev_phids' => 'required list<string>',
3131+ );
3232+ }
3333+3434+ public function defineReturnType() {
3535+ return 'void';
3636+ }
3737+3838+ public function defineErrorTypes() {
3939+ return array(
4040+ 'ERR_NO_TASKATTACHER_DEFINED' => 'No task attacher defined.',
4141+ );
4242+ }
4343+4444+ protected function execute(ConduitAPIRequest $request) {
4545+ $task_phid = $request->getValue('task_phid');
4646+ $orig_rev_phids = $request->getValue('orig_rev_phids');
4747+ if (empty($orig_rev_phids)) {
4848+ $orig_rev_phids = array();
4949+ }
5050+5151+ $new_rev_phids = $request->getValue('new_rev_phids');
5252+ if (empty($new_rev_phids)) {
5353+ $new_rev_phids = array();
5454+ }
5555+5656+ $task_class = PhabricatorEnv::getEnvConfig(
5757+ 'differential.attach-task-class');
5858+ if (!$task_class) {
5959+ throw new ConduitException('ERR_NO_TASKATTACHER_DEFINED');
6060+ }
6161+6262+ PhutilSymbolLoader::loadClass($task_class);
6363+ $task_attacher = newv($task_class, array());
6464+ $task_attacher->updateTaskRevisionAssoc(
6565+ $task_phid,
6666+ $orig_rev_phids,
6767+ $new_rev_phids);
6868+ }
6969+7070+}
7171+
···2626 $user_phid,
2727 DifferentialRevision $revision,
2828 array $task_ids);
2929+3030+ /**
3131+ * This method will be called with a task and its original and new
3232+ * associated revisions. Implementation of this method should update
3333+ * the affected revisions to maintain the new associations.
3434+ */
3535+ abstract public function updateTaskRevisionAssoc(
3636+ $task_phid,
3737+ array $orig_rev_phids,
3838+ array $new_rev_phids);
3939+2940}