original_string: protected function setModuleId($file)
      {
          $module_id = $this->getModuleIdFromZip($file);
  
          try {
              $this->module_model->checkModuleId($module_id);
          } catch (Exception $ex) {
              $this->error = $ex->getMessage();
              return false;
          }
  
          // Do not deal with enabled modules as it may cause fatal results
          // Check if the module ID actually has enabled status in the database
          // Alternative system methods are based on the scanned module folders so may return incorrect results
          if ($this->isEnabledModule($module_id)) {
              $this->error = $this->translation->text('Module @id is enabled and cannot be updated', array('@id' => $module_id));
              return false;
          }
  
          $this->module_id = $module_id;
          return true;
      }
code: protected function setModuleId($file)
      {
          $module_id = $this->getModuleIdFromZip($file);
  
          try {
              $this->module_model->checkModuleId($module_id);
          } catch (Exception $ex) {
              $this->error = $ex->getMessage();
              return false;
          }
  
          // Do not deal with enabled modules as it may cause fatal results
          // Check if the module ID actually has enabled status in the database
          // Alternative system methods are based on the scanned module folders so may return incorrect results
          if ($this->isEnabledModule($module_id)) {
              $this->error = $this->translation->text('Module @id is enabled and cannot be updated', array('@id' => $module_id));
              return false;
          }
  
          $this->module_id = $module_id;
          return true;
      }
code_tokens: protected function setModuleId ( $ file ) { $ module_id = $ this -> getModuleIdFromZip ( $ file ) ; try { $ this -> module_model -> checkModuleId ( $ module_id ) ; } catch ( Exception $ ex ) { $ this -> error = $ ex -> getMessage ( ) ; return false ; } // Do not deal with enabled modules as it may cause fatal results // Check if the module ID actually has enabled status in the database // Alternative system methods are based on the scanned module folders so may return incorrect results if ( $ this -> isEnabledModule ( $ module_id ) ) { $ this -> error = $ this -> translation -> text ( 'Module @id is enabled and cannot be updated' , array ( '@id' => $ module_id ) ) ; return false ; } $ this -> module_id = $ module_id ; return true ; }
docstring: Set a module id
  @param string $file
  @return boolean
docstring_tokens: Set a module id