Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Portfolio: Tags management by course - refs BT#18201
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() line
- Loading branch information
Showing
7 changed files
with
324 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
Oops, something went wrong.