Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace CoreBundle\Entity;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\ORM\Mapping as ORM;
- use Gedmo\Mapping\Annotation as Gedmo;
- use Sonata\TranslationBundle\Model\Gedmo\TranslatableInterface;
- use Sonata\TranslationBundle\Traits\Translatable;
- /**
- * @ORM\Entity
- * @ORM\AttributeOverrides({})
- * @Gedmo\Tree(type="nested")
- */
- class Category implements TranslatableInterface
- {
- use Translatable;
- /**
- * @ORM\Id
- * @ORM\Column(type="integer")
- * @ORM\GeneratedValue(strategy="AUTO")
- *
- */
- private $id;
- /**
- * @Gedmo\Translatable
- * @ORM\Column(type="string", length=255, nullable=false)
- */
- private $title;
- /**
- * @Gedmo\SortablePosition
- * @ORM\Column(type="integer", nullable=false)
- */
- private $position;
- /**
- * @ORM\Column(type="integer", nullable=true, name="lft")
- * @Gedmo\TreeLeft
- */
- private $left;
- /**
- * @ORM\Column(type="integer", nullable=true, name="lvl")
- * @Gedmo\TreeLevel
- */
- private $level;
- /**
- * @ORM\Column(type="integer", nullable=true, name="rgt")
- * @Gedmo\TreeRight
- */
- private $right;
- /**
- * @ORM\OneToMany(targetEntity="IpSell\Bundle\CoreBundle\Entity\Project", mappedBy="category")
- */
- private $projects;
- /**
- * @ORM\OneToMany(targetEntity="IpSell\Bundle\CoreBundle\Entity\Category", mappedBy="parent")
- * @ORM\OrderBy({"left"="ASC"})
- */
- private $children;
- /**
- * @ORM\ManyToOne(targetEntity="IpSell\Bundle\CoreBundle\Entity\Category")
- * @ORM\JoinColumn(name="root_id", referencedColumnName="id", onDelete="CASCADE")
- */
- private $root;
- /**
- * @ORM\ManyToOne(targetEntity="IpSell\Bundle\CoreBundle\Entity\Category", inversedBy="children")
- * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="CASCADE")
- * @Gedmo\TreeParent
- */
- private $parent;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement