silverstripe-framework/control/RequestProcessor.php
Will Rossiter ddcfcf7bed Update @package, @subpackage labels
Cleanup of framework's use of @package and @subpackage labels and additional of labels for classes missing packages.

Moved all GridField related components to the one name.

Countless spelling fixes, grammar for other comments.

Link ClassName references in file headers.
2013-05-21 22:24:41 +12:00

39 lines
823 B
PHP

<?php
/**
* @package framework
* @subpackage control
*/
class RequestProcessor {
private $filters = array();
public function __construct($filters = array()) {
$this->filters = $filters;
}
public function setFilters($filters) {
$this->filters = $filters;
}
public function preRequest(SS_HTTPRequest $request, Session $session, DataModel $model) {
foreach ($this->filters as $filter) {
$res = $filter->preRequest($request, $session, $model);
if ($res === false) {
return false;
}
}
}
/**
* Filter executed AFTER a request
*/
public function postRequest(SS_HTTPRequest $request, SS_HTTPResponse $response, DataModel $model) {
foreach ($this->filters as $filter) {
$res = $filter->postRequest($request, $response, $model);
if ($res === false) {
return false;
}
}
}
}