Internal: Remove unused cId, id in CAnnouncement.php

pull/3466/head
Julio Montoya 4 years ago
parent 02c608ae63
commit 8ef1823458
  1. 3
      public/main/inc/lib/AnnouncementManager.php
  2. 2
      src/CourseBundle/Entity/CAnnouncement.php
  3. 71
      src/CourseBundle/Entity/CAnnouncementAttachment.php
  4. 1
      src/CourseBundle/Entity/CExerciseCategory.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,

@ -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;

@ -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

@ -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
{

Loading…
Cancel
Save