mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-28 09:42:41 +01:00
aa6e788f36
Summary: Ref T12074. The "v3" API methods (`*.search`, `*.edit`) are currently marked as "unstable", but they're pretty stable and essentially all new code should be using them. Although these methods are seeing some changes, almost all changes are additive (support for new constraints or attachemnts) and do not break backward compatibility. We have no major, compatibility-breaking changes planned. I don't want to mark the older methods "deprecated" yet since `arc` still uses a lot of them and there are some capabilities not yet available on the v3 methods, but introduce a new "frozen" status with pointers to the new methods. Overall, this should gently push users toward the newer methods. Test Plan: {F2325323} Reviewers: chad Reviewed By: chad Maniphest Tasks: T12074 Differential Revision: https://secure.phabricator.com/D17158
46 lines
1.1 KiB
PHP
46 lines
1.1 KiB
PHP
<?php
|
|
|
|
final class ManiphestCreateTaskConduitAPIMethod
|
|
extends ManiphestConduitAPIMethod {
|
|
|
|
public function getAPIMethodName() {
|
|
return 'maniphest.createtask';
|
|
}
|
|
|
|
public function getMethodDescription() {
|
|
return pht('Create a new Maniphest task.');
|
|
}
|
|
|
|
public function getMethodStatus() {
|
|
return self::METHOD_STATUS_FROZEN;
|
|
}
|
|
|
|
public function getMethodStatusDescription() {
|
|
return pht(
|
|
'This method is frozen and will eventually be deprecated. New code '.
|
|
'should use "maniphest.edit" instead.');
|
|
}
|
|
|
|
protected function defineParamTypes() {
|
|
return $this->getTaskFields($is_new = true);
|
|
}
|
|
|
|
protected function defineReturnType() {
|
|
return 'nonempty dict';
|
|
}
|
|
|
|
protected function defineErrorTypes() {
|
|
return array(
|
|
'ERR-INVALID-PARAMETER' => pht('Missing or malformed parameter.'),
|
|
);
|
|
}
|
|
|
|
protected function execute(ConduitAPIRequest $request) {
|
|
$task = ManiphestTask::initializeNewTask($request->getUser());
|
|
|
|
$task = $this->applyRequest($task, $request, $is_new = true);
|
|
|
|
return $this->buildTaskInfoDictionary($task);
|
|
}
|
|
|
|
}
|