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.
156 lines
2.9 KiB
156 lines
2.9 KiB
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/* For licensing terms, see /license.txt */
|
|
|
|
namespace Chamilo\CoreBundle\Entity;
|
|
|
|
use Chamilo\CoreBundle\Repository\TemplatesRepository;
|
|
use Chamilo\CoreBundle\Traits\UserTrait;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
/**
|
|
* Templates.
|
|
*/
|
|
#[ORM\Table(name: 'templates')]
|
|
#[ORM\Entity(repositoryClass: TemplatesRepository::class)]
|
|
class Templates
|
|
{
|
|
use UserTrait;
|
|
|
|
#[ORM\Column(name: 'id', type: 'integer')]
|
|
#[ORM\Id]
|
|
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
|
|
protected ?int $id = null;
|
|
|
|
#[ORM\Column(name: 'title', type: 'string', length: 100, nullable: false)]
|
|
protected string $title;
|
|
|
|
#[ORM\Column(name: 'description', type: 'string', length: 250, nullable: false)]
|
|
protected string $description;
|
|
|
|
#[ORM\ManyToOne(targetEntity: Course::class, inversedBy: 'templates', cascade: ['persist'])]
|
|
#[ORM\JoinColumn(name: 'c_id', referencedColumnName: 'id')]
|
|
protected Course $course;
|
|
|
|
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'templates')]
|
|
#[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
|
|
protected User $user;
|
|
|
|
#[ORM\Column(name: 'ref_doc', type: 'integer', nullable: false)]
|
|
protected int $refDoc;
|
|
|
|
#[ORM\Column(name: 'image', type: 'string', length: 250, nullable: false)]
|
|
protected string $image;
|
|
|
|
/**
|
|
* Set title.
|
|
*
|
|
* @return Templates
|
|
*/
|
|
public function setTitle(string $title)
|
|
{
|
|
$this->title = $title;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get title.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getTitle()
|
|
{
|
|
return $this->title;
|
|
}
|
|
|
|
/**
|
|
* Set description.
|
|
*
|
|
* @return Templates
|
|
*/
|
|
public function setDescription(string $description)
|
|
{
|
|
$this->description = $description;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get description.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getDescription()
|
|
{
|
|
return $this->description;
|
|
}
|
|
|
|
/**
|
|
* Set refDoc.
|
|
*
|
|
* @return Templates
|
|
*/
|
|
public function setRefDoc(int $refDoc)
|
|
{
|
|
$this->refDoc = $refDoc;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get refDoc.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getRefDoc()
|
|
{
|
|
return $this->refDoc;
|
|
}
|
|
|
|
/**
|
|
* Set image.
|
|
*
|
|
* @return Templates
|
|
*/
|
|
public function setImage(string $image)
|
|
{
|
|
$this->image = $image;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get image.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getImage()
|
|
{
|
|
return $this->image;
|
|
}
|
|
|
|
/**
|
|
* Get id.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getId()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getCourse(): Course
|
|
{
|
|
return $this->course;
|
|
}
|
|
|
|
public function setCourse(Course $course): self
|
|
{
|
|
$this->course = $course;
|
|
|
|
return $this;
|
|
}
|
|
}
|
|
|