Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/maniphest/conduit/ManiphestCreateTaskConduitAPIMethod.php
12256 views
1
<?php
2
3
final class ManiphestCreateTaskConduitAPIMethod
4
extends ManiphestConduitAPIMethod {
5
6
public function getAPIMethodName() {
7
return 'maniphest.createtask';
8
}
9
10
public function getMethodDescription() {
11
return pht('Create a new Maniphest task.');
12
}
13
14
public function getMethodStatus() {
15
return self::METHOD_STATUS_FROZEN;
16
}
17
18
public function getMethodStatusDescription() {
19
return pht(
20
'This method is frozen and will eventually be deprecated. New code '.
21
'should use "maniphest.edit" instead.');
22
}
23
24
protected function defineParamTypes() {
25
return $this->getTaskFields($is_new = true);
26
}
27
28
protected function defineReturnType() {
29
return 'nonempty dict';
30
}
31
32
protected function defineErrorTypes() {
33
return array(
34
'ERR-INVALID-PARAMETER' => pht('Missing or malformed parameter.'),
35
);
36
}
37
38
protected function execute(ConduitAPIRequest $request) {
39
$task = ManiphestTask::initializeNewTask($request->getUser());
40
41
$task = $this->applyRequest($task, $request, $is_new = true);
42
43
return $this->buildTaskInfoDictionary($task);
44
}
45
46
}
47
48