Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
chamilo-lms/src/CoreBundle/Entity/SkillRelCourse.php

124 lines
2.6 KiB

<?php
declare(strict_types=1);
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Entity;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
/**
* SkillRelCourse.
*/
#[ORM\Table(name: 'skill_rel_course')]
#[ORM\Entity]
class SkillRelCourse
{
use TimestampableEntity;
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue]
protected ?int $id = null;
#[ORM\ManyToOne(targetEntity: \Chamilo\CoreBundle\Entity\Skill::class, inversedBy: 'courses')]
#[ORM\JoinColumn(name: 'skill_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
protected Skill $skill;
#[ORM\ManyToOne(targetEntity: \Chamilo\CoreBundle\Entity\Course::class, inversedBy: 'skills', cascade: ['persist'])]
#[ORM\JoinColumn(name: 'c_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected Course $course;
#[ORM\ManyToOne(targetEntity: \Chamilo\CoreBundle\Entity\Session::class, inversedBy: 'skills', cascade: ['persist'])]
#[ORM\JoinColumn(name: 'session_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
protected ?Session $session = null;
public function __construct()
{
$this->createdAt = new DateTime('now');
$this->updatedAt = new DateTime('now');
}
/**
* @return int
*/
public function getId()
{
return $this->id;
}
public function getSkill(): Skill
{
return $this->skill;
}
public function setSkill(Skill $skill): self
{
$this->skill = $skill;
return $this;
}
public function getCourse(): Course
{
return $this->course;
}
public function setCourse(Course $course): self
{
$this->course = $course;
return $this;
}
public function getSession(): ?Session
{
return $this->session;
}
public function setSession(?Session $session): self
{
$this->session = $session;
return $this;
}
/**
* @return DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* @return SkillRelCourse
*/
public function setCreatedAt(DateTime $createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @return DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* @return SkillRelCourse
*/
public function setUpdatedAt(DateTime $updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
}