PluginProbe
ShiftController Employee Shift Scheduling / 4.9.66
ShiftController Employee Shift Scheduling v4.9.66
4.9.97 4.9.96 4.9.95 4.9.74 4.9.75 4.9.76 4.9.77 4.9.78 4.9.84 4.9.85 4.9.87 4.9.91 4.9.92 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.2.4 All 38 releases
← All changes | sh4/app/query.php +19 -7 4.9.744.9.66 View file →
@@ -511,29 +511,41 @@
511 511
512 512 return $ret;
513 513 }
514 514
515 - public function findEmployeeByUserId( $userId )
515 + public function findEmployeeByUser( HC3_Users_Model $user )
516 516 {
517 517 $ret = null;
518 +
519 + $userId = $user->getId();
518 520 if( ! $userId ){
519 521 return $ret;
520 522 }
521 523
522 524 $employeeId = isset( $this->repoUserEmployee[$userId] ) ? $this->repoUserEmployee[$userId] : null;
525 +
526 + // $crud = $this->crudFactory->make('employee');
527 + // $args = array();
528 + // $args[] = array('user_id', '=', $userId );
529 + // $results = $crud->read( $args );
530 +
531 + // if( ! $results ){
532 + // return $ret;
533 + // }
534 +
535 + // $results = array_shift( $results );
536 + // $employeeId = array_key_exists('id', $results) ? $results['id'] : null;
537 +
523 538 if( ! $employeeId ){
524 539 return $ret;
525 540 }
526 541
542 + // $ret = $this->employeesQuery->findById( $employeeId );
543 +
527 544 if( ! isset($this->repoEmployee[$employeeId]) ){
528 545 $this->repoEmployee[$employeeId] = $this->employeesQuery->findById( $employeeId );
529 546 }
530 - $ret = $this->repoEmployee[$employeeId];
547 + $ret = $this->repoEmployee[$employeeId];
531 548
532 549 return $ret;
533 - }
534 -
535 - public function findEmployeeByUser( HC3_Users_Model $user )
536 - {
537 - return $this->self->findEmployeeByUserId( $user->getId() );
538 550 }
539 551 }