public function view($supplierId = null) { $supplierService = new SupplierService(); $supplierDetails = $supplierService->fetchDetailed($supplierId); if ($supplierDetails == null) { $this->renderView('/common/general_error', array('errorMessage' => "Oops, this supplier does not exist.")); return; } $itemsSupplied = $supplierService->fetchItemsSupplied($supplierId); $this->renderView('view', array('supplier' => $supplierDetails, 'itemsSupplied' => $itemsSupplied)); }