123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <?php
- namespace Sluggable\Fixture\Handler;
- use Gedmo\Mapping\Annotation as Gedmo;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * @Gedmo\Tree(type="nested")
- * @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\NestedTreeRepository")
- */
- class TreeSlug
- {
- /**
- * @ORM\Id
- * @ORM\GeneratedValue
- * @ORM\Column(type="integer")
- */
- private $id;
- /**
- * @ORM\Column(name="title", type="string", length=64)
- */
- private $title;
- /**
- * @Gedmo\Slug(fields={"title"}, handlers={
- * @Gedmo\SlugHandler(class="Gedmo\Sluggable\Handler\TreeSlugHandler", options={
- * @Gedmo\SlugHandlerOption(name="parentRelationField", value="parent"),
- * @Gedmo\SlugHandlerOption(name="separator", value="/")
- * })
- * }, separator="-", updatable=true)
- * @ORM\Column(name="slug", type="string", length=64, unique=true)
- */
- private $slug;
- /**
- * @Gedmo\TreeParent
- * @ORM\ManyToOne(targetEntity="TreeSlug")
- * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="CASCADE")
- */
- private $parent;
- /**
- * @Gedmo\TreeLeft
- * @ORM\Column(type="integer")
- */
- private $lft;
- /**
- * @Gedmo\TreeRight
- * @ORM\Column(type="integer")
- */
- private $rgt;
- /**
- * @Gedmo\TreeRoot
- * @ORM\Column(type="integer")
- */
- private $root;
- /**
- * @Gedmo\TreeLevel
- * @ORM\Column(name="lvl", type="integer")
- */
- private $level;
- public function setParent(TreeSlug $parent = null)
- {
- $this->parent = $parent;
- }
- public function getChildren()
- {
- return $this->children;
- }
- public function getParent()
- {
- return $this->parent;
- }
- public function getRoot()
- {
- return $this->root;
- }
- public function getLeft()
- {
- return $this->lft;
- }
- public function getRight()
- {
- return $this->rgt;
- }
- public function getLevel()
- {
- return $this->level;
- }
- public function getId()
- {
- return $this->id;
- }
- public function setTitle($title)
- {
- $this->title = $title;
- }
- public function getTitle()
- {
- return $this->title;
- }
- public function getSlug()
- {
- return $this->slug;
- }
- }
|