| 1 | <?php |
||
| 17 | abstract class DataChecker { |
||
| 18 | |||
| 19 | private $mError = null; |
||
| 20 | |||
| 21 | // Checks |
||
| 22 | private $mEnvCheckCalls = array(); |
||
| 23 | |||
| 24 | public function getError() { |
||
| 27 | |||
| 28 | public function run() { |
||
| 39 | |||
| 40 | /* |
||
|
|
|||
| 41 | * Get a value from the request. |
||
| 42 | * $err_message_id specifies an error that should be thrown |
||
| 43 | * if the value is empty |
||
| 44 | */ |
||
| 45 | protected function getUserDataValue( $id, $err_message_id = null ) { |
||
| 54 | |||
| 55 | protected function addCheck( $method_callback, array $args ) { |
||
| 58 | |||
| 59 | protected function runChecks() { |
||
| 65 | |||
| 66 | // Abstracting error calls in order to make this functionality changeable in subclasses |
||
| 67 | protected function error( $message ) { |
||
| 70 | |||
| 71 | abstract protected function populateData(); |
||
| 72 | |||
| 73 | } |
||
| 74 |