original_string: protected function createModule(StudyModuleAcademicPeriod $studyModule)
      {
          $module = ScoolModule::firstOrNew([
              'name'         => $studyModule->name,
              'study_id'     => $this->getScoolStudy()->id
          ]);
          if($studyModule->study_shortname != $this->getScoolStudy()->shortname) {
              throw new \LogicException(
                  'study_shortname in Ebre-escool study module (' . $studyModule->study_shortname
                  . ") doesn't match study shortname (" . $this->getScoolStudy()->shortname . ')');
          }
          $module->save();
          $module->order = $studyModule->order;
          $module->shortname = $studyModule->shortname;
          $module->description = $studyModule->description;
          return $module;
      }
code: protected function createModule(StudyModuleAcademicPeriod $studyModule)
      {
          $module = ScoolModule::firstOrNew([
              'name'         => $studyModule->name,
              'study_id'     => $this->getScoolStudy()->id
          ]);
          if($studyModule->study_shortname != $this->getScoolStudy()->shortname) {
              throw new \LogicException(
                  'study_shortname in Ebre-escool study module (' . $studyModule->study_shortname
                  . ") doesn't match study shortname (" . $this->getScoolStudy()->shortname . ')');
          }
          $module->save();
          $module->order = $studyModule->order;
          $module->shortname = $studyModule->shortname;
          $module->description = $studyModule->description;
          return $module;
      }
code_tokens: protected function createModule ( StudyModuleAcademicPeriod $ studyModule ) { $ module = ScoolModule :: firstOrNew ( [ 'name' => $ studyModule -> name , 'study_id' => $ this -> getScoolStudy ( ) -> id ] ) ; if ( $ studyModule -> study_shortname != $ this -> getScoolStudy ( ) -> shortname ) { throw new \ LogicException ( 'study_shortname in Ebre-escool study module (' . $ studyModule -> study_shortname . ") doesn't match study shortname (" . $ this -> getScoolStudy ( ) -> shortname . ')' ) ; } $ module -> save ( ) ; $ module -> order = $ studyModule -> order ; $ module -> shortname = $ studyModule -> shortname ; $ module -> description = $ studyModule -> description ; return $ module ; }
docstring: Create scool study module using ebre-escool study module.
  
  @param StudyModuleAcademicPeriod $studyModule
  @return mixed
  @throws \Exception
docstring_tokens: Create scool study module using ebre - escool study module .