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;
    }
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;
    }
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 ; }
Create scool study module using ebre-escool study module.

@param StudyModuleAcademicPeriod $studyModule
@return mixed
@throws \Exception
Create scool study module using ebre - escool study module .