function save($check_notify = FALSE) { if (empty($this->id)) { unset($_POST['aor_conditions_id']); unset($_POST['aor_fields_id']); } parent::save($check_notify); require_once 'modules/AOR_Fields/AOR_Field.php'; $condition = new AOR_Field(); $condition->save_lines($_POST, $this, 'aor_fields_'); require_once 'modules/AOR_Conditions/AOR_Condition.php'; $condition = new AOR_Condition(); $condition->save_lines($_POST, $this, 'aor_conditions_'); }
function save($check_notify = FALSE) { // TODO: process of saveing the fields and conditions is too long so we will have to make some optimization on save_lines functions set_time_limit(3600); if (empty($this->id)) { unset($_POST['aor_conditions_id']); unset($_POST['aor_fields_id']); } parent::save($check_notify); require_once 'modules/AOR_Fields/AOR_Field.php'; $field = new AOR_Field(); $field->save_lines($_POST, $this, 'aor_fields_'); require_once 'modules/AOR_Conditions/AOR_Condition.php'; $condition = new AOR_Condition(); $condition->save_lines($_POST, $this, 'aor_conditions_'); require_once 'modules/AOR_Charts/AOR_Chart.php'; $chart = new AOR_Chart(); $chart->save_lines($_POST, $this, 'aor_chart_'); }
public function testsave_lines() { error_reporting(E_ERROR | E_PARSE); $aor_Condition = new AOR_Condition(); //preset the required data $post_data = array(); $post_data['field'][] = 'test field'; $post_data['name'][] = 'test'; $post_data['parameter'][] = '1'; $post_data['module_path'][] = 'test path'; $post_data['operator'][] = 'test'; $post_data['value_type'][] = 'test type'; //execute the method and test if it works and does not throws an exception. try { $aor_Condition->save_lines($post_data, new AOR_Report()); $this->assertTrue(true); } catch (Exception $e) { $this->fail(); } }