TeacherController

TeacherController handle with Teacher Resource Api. Pass a Teacher Object Model(\Models\StudentModel) to the constructor of class parent (\Controller\BaseController) for it map the basic database crud operations to this Object.

Extends

Methods

inner removeByLogin(req, res) → {json}

RemoveByLogin method. Responds to DELETE /teacher/:login. If Success returns 200 status code and a json with number of rows affected (one). If error return 400 status code and a json => { errors }. 500 status code only will be returned if the method generates some unexpected error
Parameters:
Name Type Description
req object Express requisition object.
res object Express response object.
Returns:
json - status and return object.

inner teacherByLogin(req, res) → {json}

TeacherByLogin method. Responds to GET /teacher/:login. If Success returns 200 status code and a json with teacher data. If error return 400 status code and a json => { errors } 500 status code only will be returned if the method generates some unexpected error
Parameters:
Name Type Description
req object Express requisition object.
res object Express response object.
Returns:
json - status and return object.

inner updateByLogin(req, res) → {json}

UpdateByLogin method. Responds to PUT /teacher/:login. If Success returns 200 status code and a json with teacher data. If error return 400 status code and a json => { errors } 500 status code only will be returned if the method generates some unexpected error
Parameters:
Name Type Description
req object Express requisition object.
res object Express response object.
Returns:
json - status and return object.