private function contentDownloadHistoryFromRow($row)
 {
     $contentDlownloadHistory = new ContentDownloadHistory();
     $contentDlownloadHistory->cd_id = $row['cd_id'];
     $contentDlownloadHistory->cd_user_id = $row['cd_user_id'];
     $contentDlownloadHistory->cd_msisdn = $row['cd_msisdn'];
     $contentDlownloadHistory->cd_cmd_id = $row['cd_cmd_id'];
     $contentDlownloadHistory->cd_download_count = $row['cd_download_count'];
     $contentDlownloadHistory->cd_cd_id = $row['cd_cd_id'];
     $contentDlownloadHistory->cd_app_id = $row['cd_app_id'];
     $contentDlownloadHistory->cd_download_date = $row['cd_download_date'];
     $contentDlownloadHistory->unsetValues(array('created_on', 'created_by', 'updated_on', 'updated_by', 'storeId'));
     return $contentDlownloadHistory;
 }
 private function contentDownloadHistoryFromRow($row)
 {
     $contentDlownloadHistory = new ContentDownloadHistory();
     if (!empty($row['cd_id'])) {
         $contentDlownloadHistory->cd_id = $row['cd_id'];
     }
     if (!empty($row['cd_user_id'])) {
         $contentDlownloadHistory->cd_user_id = $row['cd_user_id'];
     }
     if (!empty($row['cd_msisdn'])) {
         $contentDlownloadHistory->cd_msisdn = $row['cd_msisdn'];
     }
     if (!empty($row['cd_cmd_id'])) {
         $contentDlownloadHistory->cd_cmd_id = $row['cd_cmd_id'];
     }
     if (!empty($row['cd_download_count'])) {
         $contentDlownloadHistory->cd_download_count = $row['cd_download_count'];
     }
     if (!empty($row['cd_cd_id'])) {
         $contentDlownloadHistory->cd_cd_id = $row['cd_cd_id'];
     }
     if (!empty($row['$row'])) {
         $contentDlownloadHistory->cd_app_id = $row['cd_app_id'];
     }
     if (!empty($row['downloadCount'])) {
         $contentDlownloadHistory->downloadCount = $row['downloadCount'];
     }
     if (!empty($row['sub_start_date'])) {
         $contentDlownloadHistory->sub_start_date = $row['sub_start_date'];
     }
     if (!empty($row['singleDayLimit'])) {
         $contentDlownloadHistory->singleDayLimit = $row['singleDayLimit'];
     }
     $contentDlownloadHistory->unsetValues(array('created_on', 'created_by', 'updated_on', 'updated_by', 'storeId'));
     return $contentDlownloadHistory;
 }
 public function checkDownloadLimit($request)
 {
     $json = json_encode($request->parameters);
     $contentDownloadHistory = new ContentDownloadHistory();
     $jsonObj = json_decode($json);
     $jsonMessage = $contentDownloadHistory->validateJsonForCheckDownloadLimit($jsonObj);
     if ($jsonMessage != Message::SUCCESS) {
         $response = array("status" => "ERROR", "status_code" => '400', 'msgs' => $jsonMessage);
         $this->outputError($response);
         return;
     }
     if (!$contentDownloadHistory->setValuesFromJsonObj($jsonObj)) {
         $response = array("status" => "ERROR", "status_code" => '400', 'msgs' => Message::ERROR_INVAID_REQUEST_BODY);
         $this->outputError($response);
         return;
     }
     if (trim($contentDownloadHistory->cd_msisdn) == '') {
         $response = array("status" => "ERROR", "status_code" => '400', 'msgs' => Message::ERROR_BLANK_MSISDN);
         $this->outputError($response);
         return;
     }
 }