public function checkExists($code) { return PromoCodeModel::findOne(['code' => $code]); }
protected function findModel($id) { if (($model = PromoCode::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }