public function getUserLeaveTypes()
 {
     $ele = new LeaveType();
     $empLeaveGroupId = NULL;
     $employeeId = BaseService::getInstance()->getCurrentProfileId();
     $empLeaveGroup = new LeaveGroupEmployee();
     $empLeaveGroup->Load("employee = ?", array($employeeId));
     if ($empLeaveGroup->employee == $employeeId && !empty($empLeaveGroup->id)) {
         $empLeaveGroupId = $empLeaveGroup->leave_group;
     }
     if (empty($empLeaveGroupId)) {
         $list = $ele->Find('leave_group IS NULL', array());
     } else {
         $list = $ele->Find('leave_group IS NULL or leave_group = ?', array($empLeaveGroupId));
     }
     return $list;
 }
 private function getEmployeeLeaveGroup($employeeId)
 {
     $empLeaveGroup = new LeaveGroupEmployee();
     $empLeaveGroup->Load("employee = ?", array($employeeId));
     if ($empLeaveGroup->employee == $employeeId && !empty($empLeaveGroup->id)) {
         return $empLeaveGroup->leave_group;
     }
     return null;
 }