/** * findModel * @param int $id * @return null|Company * @throws NotFoundHttpException */ private function findModel($id) { $model = Company::findOne($id); if (empty($model)) { throw new NotFoundHttpException('Company not found!'); } return $model; }