1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- namespace Tree\Fixture;
- use Gedmo\Mapping\Annotation as Gedmo;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * @ORM\Entity(repositoryClass="Tree\Fixture\Repository\BehavioralCategoryRepository")
- * @Gedmo\Tree(type="nested")
- */
- class BehavioralCategory
- {
- /**
- * @ORM\Column(name="id", type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue
- */
- private $id;
- /**
- * @Gedmo\Translatable
- * @ORM\Column(name="title", type="string", length=64)
- */
- private $title;
- /**
- * @Gedmo\TreeLeft
- * @ORM\Column(name="lft", type="integer", nullable=true)
- */
- private $lft;
- /**
- * @Gedmo\TreeRight
- * @ORM\Column(name="rgt", type="integer", nullable=true)
- */
- private $rgt;
- /**
- * @Gedmo\TreeParent
- * @ORM\ManyToOne(targetEntity="BehavioralCategory", inversedBy="children")
- * @ORM\JoinColumns({
- * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="SET NULL")
- * })
- */
- private $parent;
- /**
- * @ORM\OneToMany(targetEntity="BehavioralCategory", mappedBy="parent")
- */
- private $children;
- /**
- * @Gedmo\Translatable
- * @Gedmo\Slug(fields={"title"})
- * @ORM\Column(name="slug", type="string", length=128, unique=true)
- */
- private $slug;
- public function getId()
- {
- return $this->id;
- }
- public function getSlug()
- {
- return $this->slug;
- }
- public function setTitle($title)
- {
- $this->title = $title;
- }
- public function getTitle()
- {
- return $this->title;
- }
- public function setParent(BehavioralCategory $parent)
- {
- $this->parent = $parent;
- }
- public function getParent()
- {
- return $this->parent;
- }
- }
|