<?php
namespace App\Entity\Core\Textbook;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table('textbook_subtopic')]
#[ORM\Entity(repositoryClass: TextbookSubTopicRepository::class)]
class TextbookSubTopic
{
/**
* @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;
/**
* @var TextbookTopic
*/
#[ORM\JoinColumn(name: 'topic_id', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: TextbookTopic::class, inversedBy: 'textbookSubTopics')]
private $textbookTopic;
/**
* @var TextbookElement[]
*/
#[ORM\OneToMany(targetEntity: TextbookElement::class, mappedBy: 'textbookSubTopic', cascade: ['persist'])]
private $textbookElements;
/**
*
* @var ArrayCollection
*/
#[ORM\OneToMany(targetEntity: TextbookSubTopicQuestion::class, mappedBy: 'subTopic', cascade: ['persist', 'remove'])]
private $questions;
/**
* @var ArrayCollection|textbookSession[]
*
*/
#[ORM\ManyToMany(targetEntity: TextbookSession::class, mappedBy: 'textbookSubtopics')]
private $textbookSessions;
/**
* @var bool
*/
#[ORM\Column(type: 'boolean', name: 'is_enabled', options: ['default' => true])]
private $isEnabled;
public function getId(): int
{
return $this->id;
}
/**
* @return int
*/
public function getOrder()
{
return $this->order;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @return TextbookTopic
*/
public function getTextbookTopic()
{
return $this->textbookTopic;
}
/**
* @return TextbookElement[]
*/
public function getTextbookElements()
{
return $this->textbookElements;
}
/**
* @return TextbookSubTopicQuestion[]
*/
public function getQuestions()
{
return $this->questions;
}
public function isEnabled(): bool
{
return $this->isEnabled;
}
}