protected function insertProjectImplementation(Request $request, $id) { $array = Input::all(); $validator = Validator::make($array, ['content' => 'required']); if ($validator->fails()) { return Response::json('', 400); } else { $projectImplementation = ProjectImplementation::where('Project_FK', '=', $id)->first(); if (!empty($projectImplementation)) { $projectImplementation->content = $request->input('content'); $projectImplementation->save(); } else { $projectImplementation = new ProjectImplementation(); $projectImplementation->Project_FK = $id; $projectImplementation->content = $request->input('content'); $projectImplementation->save(); } } }
protected function getFunctionalSpecificationPercent($id) { $counter = 0; $functional = FunctionalRequirement::where('Project_FK', '=', $id)->first(); if (count($functional) > 0) { $counter++; } $implementation = ProjectImplementation::where('Project_FK', '=', $id)->first(); if (count($implementation) > 0) { $counter++; } return $counter; }