示例#1
0
 public function addEmployee($type)
 {
     $employeeSolver = new EmployeeFactory();
     $employee = $employeeSolver->solver($type);
     $employees[] = $employee;
     return $employee;
 }
示例#2
0
 function employeeList()
 {
     $list = array();
     $result = mysql_query("SELECT empid FROM employee");
     $i = 0;
     while ($row = mysql_fetch_assoc($result)) {
         $list[$i] = EmployeeFactory::createEmployee($row['empid']);
         $i++;
     }
     return $list;
 }
示例#3
0
文件: Change.php 项目: bagvendt/vaip
 function begin()
 {
     if ($user = $this->models->getUser()) {
         $reciever = EmployeeFactory::createEmployee($_POST[employee]);
         $senderShifts = ShiftFactory::createEmpShift($user->getEmployeeId());
         $recieverShifts = ShiftFactory::createEmpShift($_POST[employee]);
         $this->views->populate('recieverShifts', $recieverShifts);
         $this->views->populate('senderShifts', $senderShifts);
         $this->views->populate('reciever', $reciever);
         $this->views->flush('body', 'change');
     } else {
         header('location: /Users/Login/');
     }
 }
示例#4
0
 /**
  * Returns the date (in UNIX-time)
  * @return The date of the shift (in UNIX-time)  
  */
 function get_employee()
 {
     return EmployeeFactory::createEmployee($this->empID);
 }
示例#5
0
 function getEmployee()
 {
     return EmployeeFactory::createEmployee($this->employee_id);
 }
 public function testBadInstance()
 {
     $this->setExpectedException('Exception');
     EmployeeFactory::build('BadName');
 }