From 8ef1823458f252d922967d6c7b786df806bfa9b2 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 18 Aug 2020 10:02:17 +0200 Subject: [PATCH] Internal: Remove unused cId, id in CAnnouncement.php --- public/main/inc/lib/AnnouncementManager.php | 3 - src/CourseBundle/Entity/CAnnouncement.php | 2 +- .../Entity/CAnnouncementAttachment.php | 71 +------------------ src/CourseBundle/Entity/CExerciseCategory.php | 1 - 4 files changed, 3 insertions(+), 74 deletions(-) diff --git a/public/main/inc/lib/AnnouncementManager.php b/public/main/inc/lib/AnnouncementManager.php index 797279a8bb..12696e6534 100644 --- a/public/main/inc/lib/AnnouncementManager.php +++ b/public/main/inc/lib/AnnouncementManager.php @@ -679,9 +679,6 @@ class AnnouncementManager return false; } - $sql = "UPDATE $tbl_announcement SET id = iid WHERE iid = $last_id"; - Database::query($sql); - if (!empty($file)) { self::add_announcement_attachment_file( $announcement, diff --git a/src/CourseBundle/Entity/CAnnouncement.php b/src/CourseBundle/Entity/CAnnouncement.php index 51f1ba180e..b76a2b98fa 100644 --- a/src/CourseBundle/Entity/CAnnouncement.php +++ b/src/CourseBundle/Entity/CAnnouncement.php @@ -64,7 +64,7 @@ class CAnnouncement extends AbstractResource implements ResourceInterface, Resou /** * @var CAnnouncementAttachment[] * - * @ORM\OneToMany(targetEntity="Chamilo\CourseBundle\Entity\CAnnouncementAttachment", mappedBy="announcement", cascade={"persist", "remove"}, orphanRemoval=true) + * @ORM\OneToMany(targetEntity="CAnnouncementAttachment", mappedBy="announcement", cascade={"persist", "remove"}, orphanRemoval=true) */ protected $attachments; diff --git a/src/CourseBundle/Entity/CAnnouncementAttachment.php b/src/CourseBundle/Entity/CAnnouncementAttachment.php index cb526537ca..a285c63bc4 100644 --- a/src/CourseBundle/Entity/CAnnouncementAttachment.php +++ b/src/CourseBundle/Entity/CAnnouncementAttachment.php @@ -11,12 +11,7 @@ use Doctrine\ORM\Mapping as ORM; /** * CAnnouncementAttachment. * - * @ORM\Table( - * name="c_announcement_attachment", - * indexes={ - * @ORM\Index(name="course", columns={"c_id"}) - * } - * ) + * @ORM\Table(name="c_announcement_attachment") * @ORM\Entity */ class CAnnouncementAttachment extends AbstractResource implements ResourceInterface @@ -30,20 +25,6 @@ class CAnnouncementAttachment extends AbstractResource implements ResourceInterf */ protected $iid; - /** - * @var int - * - * @ORM\Column(name="id", type="integer", nullable=true) - */ - protected $id; - - /** - * @var int - * - * @ORM\Column(name="c_id", type="integer") - */ - protected $cId; - /** * @var string * @@ -186,54 +167,6 @@ class CAnnouncementAttachment extends AbstractResource implements ResourceInterf return $this->filename; } - /** - * Set id. - * - * @param int $id - * - * @return CAnnouncementAttachment - */ - public function setId($id) - { - $this->id = $id; - - return $this; - } - - /** - * Get id. - * - * @return int - */ - public function getId() - { - return $this->id; - } - - /** - * Set cId. - * - * @param int $cId - * - * @return CAnnouncementAttachment - */ - public function setCId($cId) - { - $this->cId = $cId; - - return $this; - } - - /** - * Get cId. - * - * @return int - */ - public function getCId() - { - return $this->cId; - } - public function getAnnouncement(): CAnnouncement { return $this->announcement; @@ -251,7 +184,7 @@ class CAnnouncementAttachment extends AbstractResource implements ResourceInterf */ public function getResourceIdentifier(): int { - return $this->getId(); + return $this->getIid(); } public function getResourceName(): string diff --git a/src/CourseBundle/Entity/CExerciseCategory.php b/src/CourseBundle/Entity/CExerciseCategory.php index 968e23ce46..a51f31b382 100644 --- a/src/CourseBundle/Entity/CExerciseCategory.php +++ b/src/CourseBundle/Entity/CExerciseCategory.php @@ -17,7 +17,6 @@ use Symfony\Component\Validator\Constraints as Assert; * * @ORM\Table(name="c_exercise_category") * @ORM\Entity(repositoryClass="Gedmo\Sortable\Entity\Repository\SortableRepository") - * */ class CExerciseCategory extends AbstractResource implements ResourceInterface {