123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426 |
- <?php
- namespace Entity;
- use Doctrine\ORM\Mapping as ORM;
- use Gedmo\Mapping\Annotation as Gedmo;
- use Doctrine\Common\Collections\ArrayCollection;
- /**
- * CurriculumCategory
- *
- * @Gedmo\Tree(type="nested")
- * @ORM\Table(name="curriculum_category")
- * @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\NestedTreeRepository")
- */
- class CurriculumCategory
- {
- /**
- * @var integer
- *
- * @ORM\Column(name="id", type="integer", precision=0, scale=0, nullable=false, unique=false)
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="IDENTITY")
- */
- private $id;
- /**
- * @var integer
- *
- * @ORM\Column(name="c_id", type="integer", precision=0, scale=0, nullable=true, unique=false)
- */
- private $cId;
- /**
- * @var integer
- *
- * @ORM\Column(name="session_id", type="integer", precision=0, scale=0, nullable=true, unique=false)
- */
- private $sessionId;
- /**
- * @var string
- *
- * @ORM\Column(name="title", type="string", length=255, precision=0, scale=0, nullable=true, unique=false)
- */
- private $title;
- /**
- * @var integer
- *
- * @ORM\Column(name="max_score", type="integer", precision=0, scale=0, nullable=false, unique=false)
- */
- private $maxScore;
- /**
- * @var boolean
- *
- * @ORM\Column(name="min_chars", type="boolean", precision=0, scale=0, nullable=false, unique=false)
- */
- private $minChars;
- /**
- * @Gedmo\TreeParent
- * @ORM\ManyToOne(targetEntity="CurriculumCategory", inversedBy="children")
- * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="SET NULL")
- */
- private $parent;
- /**
- * @var integer
- *
- * @ORM\Column(name="parent_id", type="integer", precision=0, scale=0, nullable=true, unique=false)
- */
- private $parentId;
- /**
- * @Gedmo\TreeLevel
- * @ORM\Column(name="lvl", type="integer")
- */
- private $lvl;
- /**
- * @Gedmo\TreeLeft
- * @ORM\Column(name="lft", type="integer")
- */
- private $lft;
- /**
- * @Gedmo\TreeRight
- * @ORM\Column(name="rgt", type="integer")
- */
- private $rgt;
- /**
- * @Gedmo\TreeRoot
- * @ORM\Column(name="root", type="integer", nullable=true)
- */
- private $root;
- /**
- * @ORM\OneToMany(targetEntity="CurriculumCategory", mappedBy="parent")
- * @ORM\OrderBy({"lft" = "ASC"})
- */
- private $children;
- /**
- * @ORM\OneToMany(targetEntity="CurriculumItem", mappedBy="category")
- * @ORM\OrderBy({"title" = "ASC"})
- */
- private $items;
- /**
- * @ORM\ManyToOne(targetEntity="Course")
- * @ORM\JoinColumn(name="c_id", referencedColumnName="id")
- */
- private $course;
- /**
- * @ORM\ManyToOne(targetEntity="Session")
- * @ORM\JoinColumn(name="session_id", referencedColumnName="id")
- */
- private $session;
- public function __construct()
- {
- $this->items = new ArrayCollection();
- }
- /**
- * @return mixed
- */
- public function getSession()
- {
- return $this->session;
- }
- /**
- * @param Session $session
- * @return mixed
- */
- public function setSession(Session $session)
- {
- $this->session = $session;
- }
- /**
- * @return mixed
- */
- public function getCourse()
- {
- return $this->course;
- }
- /**
- * @param Course $course
- * @return mixed
- */
- public function setCourse(Course $course)
- {
- $this->course = $course;
- }
- /**
- * @return ArrayCollection
- */
- public function getItems()
- {
- return $this->items;
- }
- /**
- * @param CurriculumCategory $parent
- */
- public function setParent(CurriculumCategory $parent = null)
- {
- $this->parent = $parent;
- }
- /**
- * @return CurriculumCategory
- */
- public function getParent()
- {
- return $this->parent;
- }
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set cId
- *
- * @param integer $cId
- * @return CurriculumCategory
- */
- public function setCId($cId)
- {
- $this->cId = $cId;
- return $this;
- }
- /**
- * Get cId
- *
- * @return integer
- */
- public function getCId()
- {
- return $this->cId;
- }
- /**
- * Set sessionId
- *
- * @param integer $sessionId
- * @return CurriculumCategory
- */
- public function setSessionId($sessionId)
- {
- $this->sessionId = $sessionId;
- return $this;
- }
- /**
- * Get sessionId
- *
- * @return integer
- */
- public function getSessionId()
- {
- return $this->sessionId;
- }
- /**
- * Set title
- *
- * @param string $title
- * @return CurriculumCategory
- */
- public function setTitle($title)
- {
- $this->title = $title;
- return $this;
- }
- /**
- * Get title
- *
- * @return string
- */
- public function getTitle()
- {
- return $this->title;
- }
- /**
- * Set maxScore
- *
- * @param integer $maxScore
- * @return CurriculumCategory
- */
- public function setMaxScore($maxScore)
- {
- $this->maxScore = $maxScore;
- return $this;
- }
- /**
- * Get maxScore
- *
- * @return integer
- */
- public function getMaxScore()
- {
- return $this->maxScore;
- }
- /**
- * Set minChars
- *
- * @param boolean $minChars
- * @return CurriculumCategory
- */
- public function setMinChars($minChars)
- {
- $this->minChars = $minChars;
- return $this;
- }
- /**
- * Get minChars
- *
- * @return boolean
- */
- public function getMinChars()
- {
- return $this->minChars;
- }
- /**
- * Set parentId
- *
- * @param integer $parentId
- * @return CurriculumCategory
- */
- public function setParentId($parentId)
- {
- $this->parentId = $parentId;
- return $this;
- }
- /**
- * Get parentId
- *
- * @return integer
- */
- public function getParentId()
- {
- return $this->parentId;
- }
- /**
- * Set lvl
- *
- * @param integer $lvl
- * @return CurriculumCategory
- */
- public function setLvl($lvl)
- {
- $this->lvl = $lvl;
- return $this;
- }
- /**
- * Get lvl
- *
- * @return integer
- */
- public function getLvl()
- {
- return $this->lvl;
- }
- /**
- * Set lft
- *
- * @param integer $lft
- * @return CurriculumCategory
- */
- public function setLft($lft)
- {
- $this->lft = $lft;
- return $this;
- }
- /**
- * Get lft
- *
- * @return integer
- */
- public function getLft()
- {
- return $this->lft;
- }
- /**
- * Set rgt
- *
- * @param integer $rgt
- * @return CurriculumCategory
- */
- public function setRgt($rgt)
- {
- $this->rgt = $rgt;
- return $this;
- }
- /**
- * Get rgt
- *
- * @return integer
- */
- public function getRgt()
- {
- return $this->rgt;
- }
- /**
- * Set root
- *
- * @param integer $root
- * @return CurriculumCategory
- */
- public function setRoot($root)
- {
- $this->root = $root;
- return $this;
- }
- /**
- * Get root
- *
- * @return integer
- */
- public function getRoot()
- {
- return $this->root;
- }
- }
|