After testing the code below produces the same results. My question is, is there a difference between the two at all?
public function someaction1(SS_HTTPRequest $request) {
$this->setResponse(new SS_HTTPResponse());
$this->getResponse()->setStatusCode(400);
$this->getResponse()->setBody('invalid');
return $this->getResponse();
}
public function someaction2(SS_HTTPRequest $request) {
$this->response = new SS_HTTPResponse();
$this->response->setStatusCode(400);
$this->response->setBody('invalid');
return $this->response;
}
To add, is return $this->response; or return $this->getResponse(); necessary or are they implicit?