Requires DB changes: CREATE TABLE portfolio_rel_tag (id INT AUTO_INCREMENT NOT NULL, tag_id INT NOT NULL, c_id INT NOT NULL, session_id INT DEFAULT NULL, INDEX IDX_DB734472BAD26311 (tag_id), INDEX IDX_DB73447291D79BD3 (c_id), INDEX IDX_DB734472613FECDF (session_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; ALTER TABLE portfolio_rel_tag ADD CONSTRAINT FK_DB734472BAD26311 FOREIGN KEY (tag_id) REFERENCES tag (id) ON DELETE CASCADE; ALTER TABLE portfolio_rel_tag ADD CONSTRAINT FK_DB73447291D79BD3 FOREIGN KEY (c_id) REFERENCES course (id) ON DELETE CASCADE; ALTER TABLE portfolio_rel_tag ADD CONSTRAINT FK_DB734472613FECDF FOREIGN KEY (session_id) REFERENCES session (id) ON DELETE CASCADE; You also need to edit src/Chamilo/CoreBundle/Entity/PortfolioRelTag.php and follow the instructions about the @ORM\Entity() linepull/4385/head
parent
0f0e95d250
commit
088402a2f0
@ -0,0 +1,88 @@ |
||||
<?php |
||||
|
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
namespace Chamilo\CoreBundle\Entity; |
||||
|
||||
use Doctrine\ORM\Mapping as ORM; |
||||
|
||||
/** |
||||
* @ORM\Table(name="portfolio_rel_tag") |
||||
* ORM\Entity() |
||||
*/ |
||||
class PortfolioRelTag |
||||
{ |
||||
/** |
||||
* @var int |
||||
* |
||||
* @ORM\Column(name="id", type="integer") |
||||
* @ORM\Id |
||||
* @ORM\GeneratedValue |
||||
*/ |
||||
protected $id; |
||||
|
||||
/** |
||||
* @var Tag |
||||
* |
||||
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Tag") |
||||
* @ORM\JoinColumn(name="tag_id", referencedColumnName="id", nullable=false, onDelete="CASCADE") |
||||
*/ |
||||
protected $tag; |
||||
|
||||
/** |
||||
* @var Course |
||||
* |
||||
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course") |
||||
* @ORM\JoinColumn(name="c_id", referencedColumnName="id", nullable=false, onDelete="CASCADE") |
||||
*/ |
||||
protected $course; |
||||
|
||||
/** |
||||
* @var Session|null |
||||
* |
||||
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session") |
||||
* @ORM\JoinColumn(name="session_id", referencedColumnName="id", onDelete="CASCADE") |
||||
*/ |
||||
protected $session; |
||||
|
||||
public function getId(): int |
||||
{ |
||||
return $this->id; |
||||
} |
||||
|
||||
public function getTag(): Tag |
||||
{ |
||||
return $this->tag; |
||||
} |
||||
|
||||
public function setTag(Tag $tag): PortfolioRelTag |
||||
{ |
||||
$this->tag = $tag; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
public function getCourse(): Course |
||||
{ |
||||
return $this->course; |
||||
} |
||||
|
||||
public function setCourse(Course $course): PortfolioRelTag |
||||
{ |
||||
$this->course = $course; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
public function getSession(): ?Session |
||||
{ |
||||
return $this->session; |
||||
} |
||||
|
||||
public function setSession(?Session $session): PortfolioRelTag |
||||
{ |
||||
$this->session = $session; |
||||
|
||||
return $this; |
||||
} |
||||
} |
Loading…
Reference in new issue