Exemplo n.º 1
0
 public function build($obj_build_exclude = array())
 {
     parent::build($obj_build_exclude);
     $this->obj_system_kinds = array();
     $hfr_system_kind = new hfr_system_kind();
     $all_hfr_system_kinds = $hfr_system_kind->get_from_hashrange($this->id);
     if ($all_hfr_system_kinds) {
         foreach ($all_hfr_system_kinds as $each_hfr_system_kind) {
             $a_hfr_system_kind = new hfr_system_kind();
             $a_hfr_system_kind->get_from_hashrange($each_hfr_system_kind['id_resource'], $each_hfr_system_kind['id']);
             $a_hfr_system_kind->build();
             $this->obj_system_kinds[] = $a_hfr_system_kind;
         }
     }
 }
Exemplo n.º 2
0
                         $props['id'] = sha1(time() . $psk . rand(2, 30));
                         $props['id_sk'] = $psk;
                         $new_hfsk->create($props);
                     }
                 }
                 if ($all_hf_sk) {
                     foreach ($all_hf_sk as $ahsk) {
                         $found_existing_hsk = FALSE;
                         foreach ($_POST['system_kind'] as $psk) {
                             if ($psk == $ahsk['id_sk']) {
                                 $found_existing_hsk = TRUE;
                             }
                         }
                         if (!$found_existing_hsk) {
                             $delete_hfrsk = new hfr_system_kind();
                             $delete_hfrsk->get_from_hashrange($current_resource->id, $ahsk['id']);
                             if ($delete_hfrsk->id != "undefined") {
                                 //print_r($delete_hfsk);
                                 $delete_hfrsk->delete();
                             }
                         }
                     }
                     // for each
                 }
                 // end if (array)
             }
             // end if (system_kind is provided)
         }
         // end else (update, not delete)
     }
 }