/** * Observer to change status of a single plan * according to all user's responses * * @param $planId * @return mixed */ public function updatePlanStatus($planId) { if (isset($planId)) { $plan = $this->model->find($planId); $testers = $plan->testers()->get(); $results = $this->getTestersTicketsStatus($plan, $testers, 'single'); } else { $plans = $this->model->all(); foreach ($plans as $plan) { $testers = $plan->testers()->get(); $results[] = $this->getTestersTicketsStatus($plan, $testers); } } return $results; }
/** * Check if same plan already exists by Jira build version * * @param $buildId * @return bool */ public function checkPlanJiraBuildVersion($buildId) { $results = $this->model->where('jira_bvid', '=', $buildId)->first(); if (isset($results->id)) { return false; } return true; }