Ejemplo n.º 1
0
 public function getCmdById($_cmdId)
 {
     return jeenodeCmd::byId($_cmdId);
 }
Ejemplo n.º 2
0
 $eqLogics_ajax = $eqReal_ajax['eqLogic'];
 $enable_eqLogic = array();
 foreach ($eqLogics_ajax as $eqLogic_ajax) {
     foreach ($eqLogic_ajax['configuration'] as $key => $value) {
         if ($key == 'portType') {
             $eqLogic_ajaxType = $value;
         }
     }
     if ($eqLogic_ajaxType != 0) {
         $eqLogic_db = new jeenode();
         utils::a2o($eqLogic_db, $eqLogic_ajax);
         $eqLogic_db->save();
         $enable_eqLogic[$eqLogic_db->getId()] = true;
         $enable_cmd = array();
         foreach ($eqLogic_ajax['cmd'] as $cmd_ajax) {
             $cmd_db = new jeenodeCmd();
             $cmd_db->setEqLogic_id($eqLogic_db->getId());
             utils::a2o($cmd_db, $cmd_ajax);
             $cmd_db->save();
             $enable_cmd[$cmd_db->getId()] = true;
         }
         //suppression des entrées non modifiées.
         foreach ($eqLogic_db->getCmd() as $cmd_db) {
             if (!isset($enable_cmd[$cmd_db->getId()])) {
                 $cmd_db->remove();
             }
         }
     } else {
         $eqLogic_db = jeenode::byId($eqLogic_ajax['id']);
         $eqLogic_db->remove();
     }