Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F971237
PonderQuestionStatusController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
886 B
Referenced Files
None
Subscribers
None
PonderQuestionStatusController.php
View Options
<?php
final
class
PonderQuestionStatusController
extends
PonderController
{
private
$status
;
private
$id
;
public
function
willProcessRequest
(
array
$data
)
{
$this
->
status
=
idx
(
$data
,
'status'
);
$this
->
id
=
idx
(
$data
,
'id'
);
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$question
=
id
(
new
PonderQuestion
())->
load
(
$this
->
id
);
if
(!
$question
)
{
return
new
Aphront404Response
();
}
switch
(
$this
->
status
)
{
case
'open'
:
$question
->
setStatus
(
PonderQuestionStatus
::
STATUS_OPEN
);
break
;
case
'close'
:
$question
->
setStatus
(
PonderQuestionStatus
::
STATUS_CLOSED
);
break
;
default
:
return
new
Aphront400Response
();
}
$question
->
save
();
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
'/Q'
.
$question
->
getID
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Jun 18, 5:41 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
226000
Default Alt Text
PonderQuestionStatusController.php (886 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment