12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?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", activateLocking=true)
- */
- class Article
- {
- /**
- * @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="Article")
- */
- private $parent;
- /**
- * @Gedmo\TreeLevel
- * @MONGO\Field(type="int")
- */
- private $level;
- /**
- * @Gedmo\TreeLockTime
- * @MONGO\Field(type="date")
- */
- private $lockTime;
- public function getId()
- {
- return $this->id;
- }
- public function setTitle($title)
- {
- $this->title = $title;
- }
- public function getTitle()
- {
- return $this->title;
- }
- public function setParent(Article $parent = null)
- {
- $this->parent = $parent;
- }
- public function getParent()
- {
- return $this->parent;
- }
- public function getLevel()
- {
- return $this->level;
- }
- public function getPath()
- {
- return $this->path;
- }
- public function getLockTime()
- {
- return $this->lockTime;
- }
- }
|