<?php
namespace App\Entity\Core\Textbook;
use App\Entity\Core\Topic\Topic;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table('textbook_topic')]
#[ORM\Entity(repositoryClass: TextbookTopicRepository::class)]
class TextbookTopic
{
/**
* @var int
*/
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;
/**
* @var int
*/
#[ORM\Column(name: 'sortorder', type: 'integer')]
private $order;
/**
* @var string
*/
#[ORM\Column(name: 'name', type: 'string', length: 255)]
private $name;
#[ORM\JoinTable(name: 'topics_textbook_topics')]
#[ORM\JoinColumn(name: 'textbook_topic_id', referencedColumnName: 'id')]
#[ORM\InverseJoinColumn(name: 'topic_id', referencedColumnName: 'id')]
#[ORM\ManyToMany(targetEntity: Topic::class)]
private $topics;
/**
* @var TextbookCategory
*/
#[ORM\JoinColumn(name: 'category_id', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: TextbookCategory::class, inversedBy: 'textbookTopics')]
private $textbookCategory;
/**
* @var TextbookSubTopic[]
*/
#[ORM\OneToMany(targetEntity: TextbookSubTopic::class, mappedBy: 'textbookTopic', cascade: ['persist'])]
private $textbookSubTopics;
/**
* @return int
*/
public function getOrder()
{
return $this->order;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @return TextbookCategory
*/
public function getTextbookCategory()
{
return $this->textbookCategory;
}
/**
* @return TextbookSubTopic[]
*/
public function getTextbookSubTopics()
{
return $this->textbookSubTopics;
}
public function getId(): int
{
return $this->id;
}
}