protected function createSubmodule(StudySubModule $srcSubmodule)
    {
        //First Or new
        $id = $this->SubModuleAlreadyExists($srcSubmodule);
        if ($id != null) {
            $submodule = Submodule::findOrFail($id);
        } else {
            $submodule = new Submodule();
        }

        $submodule->name = $srcSubmodule->name;
        $submodule->order = $srcSubmodule->order;
        $submodule->type = $this->mapTypes($srcSubmodule->type->id);
        $submodule->save();
        $submodule->altnames = [
            'shortname'   => $srcSubmodule->shortname,
            'description' => $srcSubmodule->description
        ];

        $submodule->addModule($this->getScoolModule());
        return $submodule;
    }
protected function createSubmodule(StudySubModule $srcSubmodule)
    {
        //First Or new
        $id = $this->SubModuleAlreadyExists($srcSubmodule);
        if ($id != null) {
            $submodule = Submodule::findOrFail($id);
        } else {
            $submodule = new Submodule();
        }

        $submodule->name = $srcSubmodule->name;
        $submodule->order = $srcSubmodule->order;
        $submodule->type = $this->mapTypes($srcSubmodule->type->id);
        $submodule->save();
        $submodule->altnames = [
            'shortname'   => $srcSubmodule->shortname,
            'description' => $srcSubmodule->description
        ];

        $submodule->addModule($this->getScoolModule());
        return $submodule;
    }
protected function createSubmodule ( StudySubModule $ srcSubmodule ) { //First Or new $ id = $ this -> SubModuleAlreadyExists ( $ srcSubmodule ) ; if ( $ id != null ) { $ submodule = Submodule :: findOrFail ( $ id ) ; } else { $ submodule = new Submodule ( ) ; } $ submodule -> name = $ srcSubmodule -> name ; $ submodule -> order = $ srcSubmodule -> order ; $ submodule -> type = $ this -> mapTypes ( $ srcSubmodule -> type -> id ) ; $ submodule -> save ( ) ; $ submodule -> altnames = [ 'shortname' => $ srcSubmodule -> shortname , 'description' => $ srcSubmodule -> description ] ; $ submodule -> addModule ( $ this -> getScoolModule ( ) ) ; return $ submodule ; }
Create scool study submodule using ebre-escool study submodule.

@param StudySubModule $srcSubmodule
@return ScoolSubmodule
Create scool study submodule using ebre - escool study submodule .