예제 #1
0
    $log->debug($entityBody);
    $formController = new Stratum\Controller\FormController();
    $log->debug("parsing input data");
    $formResult = $formController->parse($entityBody);
    $formResult->setLogger($log);
    //form has updated mappings for each question
    $candidate = new Stratum\Model\Candidate();
    $candidate->setLogger($log);
    $log->debug("parsed input data");
    $candidateController = new Stratum\Controller\CandidateController();
    $candidateController->setLogger($log);
    $candidate = $candidateController->populate($candidate, $formResult);
    $log->debug("Candidate submitted with name " . $candidate->getName());
    $controller = new Stratum\Controller\BullhornController();
    $controller->setLogger($log);
    $controller->submit($candidate);
});
$app->get('/launch', function () use($app) {
    $app->redirect('http://northcreek.ca/stratum/launch.html');
});
$app->get('/launchForm', function (Request $request, Response $response) use($log) {
    // this is all the happy path assuming everything is set up properly from the Bullhorn side
    //load the id from the request
    $id = $request->getAttribute('entityid');
    //set up the controllers and their loggers
    $wcontroller = new \Stratum\Controller\WorldappController();
    $bcontroller = new \Stratum\Controller\BullhornController();
    $bcontroller->setLogger($log);
    $wcontroller->setLogger($log);
    //find the correct form
    $form = $wcontroller->find_form_by_name('Registration Form - Stratum International');