Example #1
0
 public function create_from_xml_array($data)
 {
     parent::create_from_xml_array($data);
     $this->obj_match_customs = array();
     $this->obj_match_entries = array();
     // customs
     if (isset($data['customs'])) {
         if (isset($data['customs']['match_custom'])) {
             if (isset($data['customs']['match_custom']['@attributes'])) {
                 $match_custom = new match_custom();
                 $match_custom->obj_version = $this->obj_version;
                 $match_custom->create_from_xml_array($data['customs']['match_custom']);
                 $this->obj_match_customs[] = $match_custom;
             } else {
                 foreach ($data['customs']['match_custom'] as $mcustom) {
                     $match_custom = new match_custom();
                     $match_custom->obj_version = $this->obj_version;
                     $match_custom->create_from_xml_array($mcustom);
                     $this->obj_match_customs[] = $match_custom;
                 }
             }
         }
     }
     // matchentries
     if (isset($data['matchentries'])) {
         if (isset($data['matchentries']['match_entry'])) {
             if (isset($data['matchentries']['match_entry']['@attributes'])) {
                 $match_entry = new match_entry();
                 $match_entry->obj_version = $this->obj_version;
                 $match_entry->create_from_xml_array($data['matchentries']['match_entry']);
                 $this->obj_match_entries[] = $match_entry;
             } else {
                 foreach ($data['matchentries']['match_entry'] as $mentry) {
                     $match_entry = new match_entry();
                     $match_entry->obj_version = $this->obj_version;
                     $match_entry->create_from_xml_array($mentry);
                     $this->obj_match_entries[] = $match_entry;
                 }
             }
         }
     }
 }
Example #2
0
     $props = array();
     $props["id_expr"] = $_POST['id_expr'];
     $props["idx_id"] = $idx_id . "#" . $sha1_new_me_id;
     $props["id_entry_type"] = $_POST['id_entry_type'];
     $props["id_entry_subtype"] = $_POST['id_entry_subtype'];
     $props["int_order"] = $max_order_count . "";
     $new_me = new match_entry();
     $new_me->create($props);
 }
 if ($_GET['action'] == "update-match-entry") {
     if (isset($_POST['btnDelete'])) {
         $match_entry = new match_entry();
         $match_entry->get_from_hashrange($_POST['id_expr'], $_POST['idx_id']);
         $match_entry->delete();
     } else {
         $match_entry = new match_entry();
         $match_entry->get_from_hashrange($_POST['id_expr'], $_POST['idx_id']);
         $match_entry->update(array("id_entry_subtype" => $_POST['id_entry_subtype']));
         // DATABASE CONNECTION SUBSETTINGS
         // LEVEL 2 - ADDSET OR ADDWHERE BUTTONS HIT
         foreach ($_POST as $PK => $PV) {
             if (strpos($PK, 'btn_subsetting_db_action_') === 0 && endsWith($PK, "_addset")) {
                 $match_entry->build();
                 $db_action_prefix = str_replace("_addset", "", $PK);
                 $db_action_prefix = str_replace("btn_", "", $db_action_prefix);
                 $max_set_found = 0;
                 foreach ($match_entry->obj_me_settings as $mes) {
                     if (strpos($mes->name, $db_action_prefix . "_set_") === 0 && endsWith($mes->name, "_name")) {
                         $mes_name = $mes->name;
                         $mes_name = str_replace($db_action_prefix . "_set_", "", $mes_name);
                         $mes_name = str_replace("_name", "", $mes_name);