예제 #1
0
 public function getContentDeliveryTypesById($request)
 {
     $json = json_encode($request->parameters);
     $contents = new Contents();
     $jsonObj = json_decode($json);
     $jsonMessage = $contents->validateJsonForContentMetadata($jsonObj);
     if ($jsonMessage != Message::SUCCESS) {
         $response = array("status" => "ERROR", "status_code" => '400', 'msgs' => $jsonMessage);
         $this->outputError($response);
         return;
     }
     if (!$contents->setValuesFromJsonObj($jsonObj)) {
         $response = array("status" => "ERROR", "status_code" => '400', 'msgs' => Message::ERROR_INVAID_REQUEST_BODY);
         $this->outputError($response);
         return;
     }
     if (trim($contents->cm_id) == '') {
         $response = array("status" => "ERROR", "status_code" => '400', 'msgs' => Message::ERROR_BLANK_CMD_ID);
         $this->outputError($response);
         return;
     }
     $contentMetaDataObj = $contents->getContentDeliveryTypesById($contents->cm_id);
     //if(!empty($contentMetaDataObj)){
     $response = array("status" => "SUCCESS-BUSINESS", "status_code" => '200', 'contentDeliveryType' => $contentMetaDataObj);
     $this->outputSuccess($response);
     return;
     /*}else{
           $response = array("status" => "ERROR-BUSINESS", "status_code" => '404', 'msgs' => 'No content metadata information available !.' );
           $this->outputError($response);
           return;
       }*/
 }