self = $hooks->wrap( $this ); $this->request = $request; $this->appQuery = $hooks->wrap( $appQuery ); $this->employeesQuery = $hooks->wrap( $employeesQuery ); $this->newQuery = $hooks->wrap( $newQuery ); } public function render() { $to = $this->getTo(); $params = $this->request->getParams(); if( $params ){ $to = array( $to, $params ); } $return = array( $to, NULL ); return $return; } protected function getTo() { $return = NULL; $params = $this->request->getParams(); if( ! (array_key_exists('calendar', $params) && array_key_exists('shifttype', $params)) ){ $return = 'new/calendar'; return $return; } if( ! array_key_exists('date', $params) ){ $return = 'new/date'; return $return; } if( ! array_key_exists('employee', $params) ){ $return = 'new/employee'; return $return; } if( ! $return ){ $return = 'new/confirm'; return $return; } } }