public function actionSetBid() { $model = new Bidding(); if (isset($_POST['Bidding'])) { if ($model->canUserBid($_POST['Bidding']['fk_user'])) { $model->attributes = $_POST['Bidding']; $model->created_at = $this->getCurrentDateTime(); if ($model->save()) { $this->apiResponse['success'] = true; } } else { $this->apiResponse['message'] = 'Maximum bid count exceeded'; } } $this->sendResponse(); }