private function create_employee($row) { $obj = new Employee(); $obj->setEMPID($row["EmpId"]); $obj->setEmpName($row["EmpName"]); $obj->setDob(new \DateTime($row["dob"])); $obj->setGender($row["gender"]); $obj->setUsername($row["userName"]); $obj->setPassword($row["password"]); $obj->setRole($row["role"]); $obj->setMobileNumber($row["mobileNumber"]); return $obj; }
function registerEmployee() { $request = Slim::getInstance()->request(); $empJson = json_decode($request->getBody()); $empJson->EmpId = 0; $emp = new Employee(); $emp->parseJsonObject($empJson); $dao = new EmployeeDAO(); if ($dao->insertEmployee($emp)) { echo 'Success'; } else { die; } }
public function testEmployeeInsert() { $emp = new Employee(); $emp->setEmpName("Emp1"); $emp->setDob(new DateTime('now')); $emp->setGender('M'); $emp->setUserName("user1"); $emp->setPassword("1234"); $emp->setRole("Admin"); $emp->setMobileNumber("902321321"); assert($this->dao->insertEmployee($emp) == true, "Employee Insertion"); }
public function testEmp() { $emp = new Employee(); $emp->setEmpID("001"); assert($emp->getEmpId() == "001", "Emp set method test"); }