application/models/Report_model.php
/**
     * Appends child objects to service logs
     * 
     * @param type $servicelog_id
     * @param type $service_logs
     * @return type
     */
Appends child objects to service logs


Appends child objects to service logs
private function appendServiceLogChildren($servicelog_id, $service_logs, $params = []) {
        $service_logs[0]['serviced_by'] = $this->getServicedBy($servicelog_id);
        $entry_type = '';
        if(!empty($params) && array_key_exists($params['data'])) {
            $entry_type = $params['data']['entry_type'];
        } else {
            $entry_type = $service_logs[0]['entry_type'];
        }
        switch($entry_type) {
            case 'SMR Update':
                $service_logs[0]['update_detail'] = $this->getSMRUpdateDetail($servicelog_id);
                break;
            case 'PM Service':
                $service_logs[0]['update_detail'] = $this->getPMServiceDetail($servicelog_id);
                break;
            case 'Fluid Entry':
                $service_logs[0]['update_detail'] = $this->getFluidEntryDetail($servicelog_id);
                $service_logs[0]['fluidentry_smr_detail'] = $this->getFluidEntrySMRUpdateDetail($servicelog_id);
                break;
            case 'Component Change':
                $service_logs[0]['update_detail'] = $this->getComponentChangeDetail($servicelog_id);
                $service_logs[0]['componentchange_smr_detail'] = $this->getComponentChangeSMRUpdateDetail($servicelog_id);
                break;
        }
        return $service_logs;
    }
private function appendServiceLogChildren ( $ servicelog_id , $ service_logs , $ params = [ ] ) { $ service_logs [ 0 ] [ 'serviced_by' ] = $ this -> getServicedBy ( $ servicelog_id ) ; $ entry_type = '' ; if ( ! empty ( $ params ) && array_key_exists ( $ params [ 'data' ] ) ) { $ entry_type = $ params [ 'data' ] [ 'entry_type' ] ; } else { $ entry_type = $ service_logs [ 0 ] [ 'entry_type' ] ; } switch ( $ entry_type ) { case 'SMR Update' : $ service_logs [ 0 ] [ 'update_detail' ] = $ this -> getSMRUpdateDetail ( $ servicelog_id ) ; break ; case 'PM Service' : $ service_logs [ 0 ] [ 'update_detail' ] = $ this -> getPMServiceDetail ( $ servicelog_id ) ; break ; case 'Fluid Entry' : $ service_logs [ 0 ] [ 'update_detail' ] = $ this -> getFluidEntryDetail ( $ servicelog_id ) ; $ service_logs [ 0 ] [ 'fluidentry_smr_detail' ] = $ this -> getFluidEntrySMRUpdateDetail ( $ servicelog_id ) ; break ; case 'Component Change' : $ service_logs [ 0 ] [ 'update_detail' ] = $ this -> getComponentChangeDetail ( $ servicelog_id ) ; $ service_logs [ 0 ] [ 'componentchange_smr_detail' ] = $ this -> getComponentChangeSMRUpdateDetail ( $ servicelog_id ) ; break ; } return $ service_logs ; }
Appends child objects to service logs
Appends child objects to service logs