public function copyFromEqLogic($_eqLogic_id)
 {
     $eqLogic = eqLogic::byId($_eqLogic_id);
     if (!is_object($eqLogic)) {
         throw new Exception(__('Impossible de trouver l\'équipement : ', __FILE__) . $_eqLogic_id);
     }
     if ($eqLogic->getEqType_name() == 'virtual') {
         throw new Exception(__('Vous ne pouvez importer la configuration d\'un équipement virtuel', __FILE__));
     }
     foreach ($eqLogic->getCategory() as $key => $value) {
         $this->setCategory($key, $value);
     }
     foreach ($eqLogic->getCmd() as $cmd_def) {
         $cmd = new virtualCmd();
         $cmd->setName($cmd_def->getName());
         $cmd->setEqLogic_id($this->getId());
         $cmd->setIsVisible($cmd_def->getIsVisible());
         $cmd->setType($cmd_def->getType());
         $cmd->setUnite($cmd_def->getUnite());
         $cmd->setOrder($cmd_def->getOrder());
         $cmd->setDisplay('icon', $cmd_def->getDisplay('icon'));
         $cmd->setDisplay('invertBinary', $cmd_def->getDisplay('invertBinary'));
         foreach ($cmd_def->getTemplate() as $key => $value) {
             $cmd->setTemplate($key, $value);
         }
         $cmd->setSubType($cmd_def->getSubType());
         if ($cmd->getType() == 'info') {
             $cmd->setConfiguration('calcul', '#' . $cmd_def->getId() . '#');
             $cmd->setValue($cmd_def->getId());
             $cmd->setEventOnly(1);
         } else {
             $cmd->setValue($cmd_def->getValue());
             $cmd->setConfiguration('infoName', '#' . $cmd_def->getId() . '#');
         }
         $cmd->save();
     }
     $this->save();
 }