ManagerAPI::__construct PHP Method

__construct() public method

Init database, sanitize parameters, and check if worker is valid
public __construct ( $request )
    public function __construct($request)
    {
        $this->loadConfig();
        $this->initDB();
        if ($this->isValidWorker() == false) {
            echo "Not valid worker";
            exit(1);
        } else {
            $this->insert("UPDATE Worker SET lastRequestTime = now() WHERE apiKey = {$this->apiKey}");
        }
        parent::__construct($request);
    }