Skip to content

Instantly share code, notes, and snippets.

@makoru-hikage
Created August 25, 2017 00:55
Show Gist options
  • Save makoru-hikage/db6e5f3154b112adc3a3be8b18c4991b to your computer and use it in GitHub Desktop.
Save makoru-hikage/db6e5f3154b112adc3a3be8b18c4991b to your computer and use it in GitHub Desktop.
What can you infer? This is a function that fetches a certain student record. It's validated and authenticated.
<?php
public function getChecklist($request, $response, $urlParams){
$input = $request->getQueryParams();
$input['student_number'] = $urlParams['student_number'];
$output = (new MultipleReadModule ($input))
->setRepository(new CentralRepository)
->setModelService('DeltaX\Aegis\ModelServices\GradesRegistry\StudentChecklist')
->setUserIdentity('DeltaX\Aegis\ModelServices\UserManagement\StudentIdentity')
->setIdentityValue($input['student_number'])
->setValidationSet(new ChecklistSearchValidation)
->setAuthenticationAdapter($this->app->auth)
->run();
return $response->withJson($output['data'], $output['code']);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment