/** * private * generate arrays of check ids, prerequisite check ids, next check ids * array structure: check_array ( [html_tag] => Array ( [0] => check_id 1 [1] => check_id 2 ... ) ... ) prerequisite_check_array ( [check_id] => Array ( [0] => prerequisite_check_id 1 [1] => prerequisite_check_id 2 ... ) ... ) // next_check_array // ( // [check_id] => Array // ( // [0] => next_check_id 1 // [1] => next_check_id 2 // ... // ) ... ) */ private function prepare_check_arrays($guidelines) { if (!is_array($guidelines)) { return false; } else { $checksDAO = new ChecksDAO(); // generate array of "all element" $rows = $checksDAO->getOpenChecksForAllByGuidelineIDs($guidelines); $count = 0; if (is_array($rows)) { foreach ($rows as $id => $row) { $this->check_for_all_elements_array[$count++] = $row["check_id"]; } } // generate array of check_id $rows = $checksDAO->getOpenChecksNotForAllByGuidelineIDs($guidelines); if (is_array($rows)) { foreach ($rows as $id => $row) { if ($row["html_tag"] != $prev_html_tag && $prev_html_tag != "") { $count = 0; } $this->check_for_tag_array[$row["html_tag"]][$count++] = $row["check_id"]; $prev_html_tag = $row["html_tag"]; } } // generate array of prerequisite check_ids $rows = $checksDAO->getOpenPreChecksByGuidelineIDs($guidelines); if (is_array($rows)) { foreach ($rows as $id => $row) { if ($row["check_id"] != $prev_check_id) { $prerequisite_check_array[$row["check_id"]] = array(); } array_push($prerequisite_check_array[$row["check_id"]], $row["prerequisite_check_id"]); $prev_check_id = $row["check_id"]; } } $this->prerequisite_check_array = $prerequisite_check_array; return true; } }