diff --git a/main/gradebook/lib/be/category.class.php b/main/gradebook/lib/be/category.class.php index 5a20ccdc2a..e4af6399c9 100755 --- a/main/gradebook/lib/be/category.class.php +++ b/main/gradebook/lib/be/category.class.php @@ -519,22 +519,22 @@ class Category implements GradebookItem if (isset($this->name) && isset($this->user_id)) { $em = Database::getManager(); - $foo = new \Chamilo\CoreBundle\Entity\GradebookCategory(); - $foo->setName($this->name); - $foo->setDescription($this->description); - $foo->setUserId($this->user_id); - $foo->setCourseCode($this->course_code); - $foo->setParentId($this->parent); - $foo->setWeight($this->weight); - $foo->setVisible($this->visible); - $foo->setCertifMinScore($this->certificate_min_score); - $foo->setSessionId($this->session_id); - $foo->setGenerateCertificates($this->generateCertificates); - $foo->setGradeModelId($this->grade_model_id); - $foo->setIsRequirement($this->isRequirement); - $foo->setLocked(false); - - $em->persist($foo); + $category = new \Chamilo\CoreBundle\Entity\GradebookCategory(); + $category->setName($this->name); + $category->setDescription($this->description); + $category->setUserId($this->user_id); + $category->setCourseCode($this->course_code); + $category->setParentId($this->parent); + $category->setWeight($this->weight); + $category->setVisible($this->visible); + $category->setCertifMinScore($this->certificate_min_score); + $category->setSessionId($this->session_id); + $category->setGenerateCertificates($this->generateCertificates); + $category->setGradeModelId($this->grade_model_id); + $category->setIsRequirement($this->isRequirement); + $category->setLocked(false); + + $em->persist($category); $em->flush(); $id = Database::insert_id(); diff --git a/src/Chamilo/CoreBundle/Entity/GradebookCategory.php b/src/Chamilo/CoreBundle/Entity/GradebookCategory.php index 574f714f57..250b6370e6 100644 --- a/src/Chamilo/CoreBundle/Entity/GradebookCategory.php +++ b/src/Chamilo/CoreBundle/Entity/GradebookCategory.php @@ -12,9 +12,7 @@ use Doctrine\ORM\Mapping as ORM; */ class GradebookCategory { - public function setId($f) { - $this->id = $f; -} + /** * @var string *