/** * @see \wcf\data\DatabaseObjectList::readObjects() */ public function readObjects() { if ($this->objectIDs === null) { $this->readObjectIDs(); } parent::readObjects(); }
<?php include_once 'semsol/ARC2.php'; /* ARC2 static class inclusion */ include_once 'question/QuestionList.php'; $QuestionList = new QuestionList(); $questions = $QuestionList->load(); $question = $_GET['question']; foreach ($questions as $existingQuestion) { if (trim($existingQuestion["fulltext"]) == trim($question)) { $entities = $existingQuestion["entities"]; break; } } $property = ""; $location = ""; $organization = ""; foreach ($entities as $entity) { if ($entity["type"] == "PROPERTY") { $property = $entity["property"]; } else { if ($entity["type"] == "LOCATION" && strlen($location) == 0) { $location = $entity["name"]; } else { if (strlen($organization) == 0) { $organization = $entity["name"]; } else { if (strlen($location) == 0) { $location = $entity["name"]; } }
<?php header('content-type: application/json; charset=utf-8'); header('Access-Control-Allow-Origin: *'); $questionTypeId = isset($_GET['typeId']) ? $_GET['typeId'] : null; $levelIds = isset($_GET['levelIds']) ? $_GET['levelIds'] : array(); $question = new QuestionList(); $questionType = new QuestionType(); $questionLevel = new QuestionLevel(); $resp = array(); $resp['questionList'] = $question->getAllQuestions($questionTypeId, $levelIds); $resp = json_encode($resp); echo $_REQUEST['callback'] . '(' . $resp . ')';
<?php include_once 'QuestionList.php'; $questionList = new QuestionList(); $question = $_GET['question']; try { echo $questionList->addQuestion($question); header('HTTP/1.1 201 Created', true, 201); } catch (Exception $e) { echo $e->getMessage(); header('HTTP/1.1 400 Bad Request', true, 400); }