plugin/exo/Manager/ExerciseManager.php
public function copy(Exercise $exercise)
    {
        // Serialize quiz entities
        $exerciseData = $this->serializer->serialize($exercise, [Transfer::INCLUDE_SOLUTIONS]);

        // Populate new entities with original data
        $newExercise = $this->createCopy($exerciseData, null);

        // Save copy to db
        $this->om->flush();

        return $newExercise;
    }
public function copy(Exercise $exercise)
    {
        // Serialize quiz entities
        $exerciseData = $this->serializer->serialize($exercise, [Transfer::INCLUDE_SOLUTIONS]);

        // Populate new entities with original data
        $newExercise = $this->createCopy($exerciseData, null);

        // Save copy to db
        $this->om->flush();

        return $newExercise;
    }
public function copy ( Exercise $ exercise ) { // Serialize quiz entities $ exerciseData = $ this -> serializer -> serialize ( $ exercise , [ Transfer :: INCLUDE_SOLUTIONS ] ) ; // Populate new entities with original data $ newExercise = $ this -> createCopy ( $ exerciseData , null ) ; // Save copy to db $ this -> om -> flush ( ) ; return $ newExercise ; }
Copies an Exercise resource.

@param Exercise $exercise

@return Exercise
Copies an Exercise resource .