1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- namespace Tree\Fixture\Document;
- use Gedmo\Mapping\Annotation as Gedmo;
- use Doctrine\ODM\MongoDB\Mapping\Annotations as MONGO;
- /**
- * @MONGO\Document(repositoryClass="Gedmo\Tree\Document\MongoDB\Repository\MaterializedPathRepository")
- * @Gedmo\Tree(type="materializedPath")
- */
- class Category
- {
- /**
- * @MONGO\Id
- */
- private $id;
- /**
- * @MONGO\Field(type="string")
- * @Gedmo\TreePathSource
- */
- private $title;
- /**
- * @MONGO\Field(type="string")
- * @Gedmo\TreePath(separator="|")
- */
- private $path;
- /**
- * @Gedmo\TreeParent
- * @MONGO\ReferenceOne(targetDocument="Category")
- */
- private $parent;
- /**
- * @Gedmo\TreeLevel
- * @MONGO\Field(type="int")
- */
- private $level;
- public function getId()
- {
- return $this->id;
- }
- public function setTitle($title)
- {
- $this->title = $title;
- }
- public function getTitle()
- {
- return $this->title;
- }
- public function setParent(Category $parent = null)
- {
- $this->parent = $parent;
- }
- public function getParent()
- {
- return $this->parent;
- }
- public function getLevel()
- {
- return $this->level;
- }
- public function getPath()
- {
- return $this->path;
- }
- }
|