/** * * * @return be_vse_data */ function execute() { $registeredEntry = new be_vse_data(); try { $access = "RW"; include './inc/incWebServiceAPIKeyValidation.php'; $entryToAdd = new be_vse_data(); $entryToAdd->app_id = filter_input(INPUT_GET, "app_id"); $entryToAdd->vse_label = filter_input(INPUT_GET, "label"); $entryToAdd->vse_value = filter_input(INPUT_GET, "value"); $entryToAdd->vse_type = filter_input(INPUT_GET, "type"); $entryToAdd->vse_annotations = filter_input(INPUT_GET, "annotations"); $entryToAdd->captured_datetime = filter_input(INPUT_GET, "captured_datetime"); if (!isset($entryToAdd->captured_datetime) || $entryToAdd->captured_datetime == '') { $dateX = new DateTime(); $entryToAdd->captured_datetime = $dateX->format("Y-m-d H:i:s.u"); } if (validate($entryToAdd)) { $registeredEntry = da_vse_data::AddEntry($entryToAdd); } else { die("Parámetros Inválidos"); } } catch (Exception $ex) { die("EXCEPTION " . $ex->getCode()); } return $registeredEntry; }
private static function createVSEEntry($params) { $vseEntry = new be_vse_data(); $vseEntry->app_id = $params->app_id; $vseEntry->vse_label = $params->vse_label; $fileSimpleObject = new stdClass(); $fileSimpleObject->file_name = $params->file_name; $fileSimpleObject->file_guid = $params->file_guid; $vseEntry->vse_value = json_encode($fileSimpleObject); $vseEntry->vse_type = "_FILE_"; $vseEntry->vse_annotations = $params->vse_annotations; $vseEntry->captured_datetime = $params->captured_datetime; $savedEntry = da_vse_data::AddEntry($vseEntry); return $savedEntry; }
private static function testClearEntries($uuid) { ReportInfo("Testing Clearing Entries"); ReportInfo("Clearing All"); $result = da_vse_data::ClearEntries(1, ""); ReportInfo("Result:"); print_r($result); for ($i = 1; $i <= 10; $i++) { $entry = new be_vse_data(); $entry->app_id = 1; $entry->vse_label = "TEST FOR CLEARING_01"; $entry->vse_value = $i . "OK"; $entry->vse_type = "ANY"; $entry->vse_annotations = "Testing for clearing methods"; $entry->captured_datetime = date("Y-m-d H:i:s"); da_vse_data::AddEntry($entry); } for ($i = 1; $i <= 10; $i++) { $entry = new be_vse_data(); $entry->app_id = 1; $entry->vse_label = "TEST FOR CLEARING_02"; $entry->vse_value = $i . "OK"; $entry->vse_type = "ANY"; $entry->vse_annotations = "Testing for clearing methods"; $entry->captured_datetime = date("Y-m-d H:i:s"); da_vse_data::AddEntry($entry); } ReportInfo("Getting all entries..."); $allrecords = da_vse_data::GetEntries(1, '', 0); print_r($allrecords); ReportInfo("Clearing TEST_FOR_CLEARING_02"); $check01 = da_vse_data::ClearEntries(1, 'TEST FOR CLEARING_02'); print_r($check01); ReportInfo("Getting all entries again..."); $allrecords = da_vse_data::GetEntries(1, '', 0); print_r($allrecords); ReportInfo("Clearing TEST_FOR_CLEARING_01"); $check02 = da_vse_data::ClearEntries(1, 'TEST FOR CLEARING_01'); print_r($check02); ReportInfo("At this point all should be clear for app 1"); $allrecords = da_vse_data::GetEntries(1, '', 0); print_r($allrecords); }