Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F106006597
ConduitAPI_differential_markcommitted_Method.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Mar 21, 11:18
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Mar 23, 11:18 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
25095214
Attached To
rPH Phabricator
ConduitAPI_differential_markcommitted_Method.php
View Options
<?php
/**
* @group conduit
* @deprecated
*/
final
class
ConduitAPI_differential_markcommitted_Method
extends
ConduitAPIMethod
{
public
function
getMethodStatus
()
{
return
self
::
METHOD_STATUS_DEPRECATED
;
}
public
function
getMethodStatusDescription
()
{
return
"Replaced by 'differential.close'."
;
}
public
function
getMethodDescription
()
{
return
"Mark a revision closed."
;
}
public
function
defineParamTypes
()
{
return
array
(
'revision_id'
=>
'required revision_id'
,
);
}
public
function
defineReturnType
()
{
return
'void'
;
}
public
function
defineErrorTypes
()
{
return
array
(
'ERR_NOT_FOUND'
=>
'Revision was not found.'
,
);
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$id
=
$request
->
getValue
(
'revision_id'
);
$revision
=
id
(
new
DifferentialRevisionQuery
())
->
withIDs
(
array
(
$id
))
->
setViewer
(
$request
->
getUser
())
->
needRelationships
(
true
)
->
needReviewerStatus
(
true
)
->
executeOne
();
if
(!
$revision
)
{
throw
new
ConduitException
(
'ERR_NOT_FOUND'
);
}
if
(
$revision
->
getStatus
()
==
ArcanistDifferentialRevisionStatus
::
CLOSED
)
{
return
;
}
$editor
=
new
DifferentialCommentEditor
(
$revision
,
DifferentialAction
::
ACTION_CLOSE
);
$editor
->
setActor
(
$request
->
getUser
());
$editor
->
save
();
}
}
Event Timeline
Log In to Comment