123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- namespace Tree\Fixture;
- /**
- * @Entity(repositoryClass="Gedmo\Tree\Repository\TreeNodeRepository")
- * @InheritanceType("SINGLE_TABLE")
- * @DiscriminatorColumn(name="discriminator", type="string")
- * @DiscriminatorMap({"base" = "BaseNode", "node" = "Node"})
- */
- class BaseNode extends ANode
- {
- /**
- * @gedmo:TreeParent
- * @ManyToOne(targetEntity="BaseNode", inversedBy="children")
- */
- private $parent;
-
- /**
- * @OneToMany(targetEntity="BaseNode", mappedBy="parent")
- */
- private $children;
-
- /**
- * @gedmo:Timestampable(on="create")
- * @Column(type="datetime")
- */
- private $created;
-
- /**
- * @Column(length=128, unique=true)
- */
- private $identifier;
-
- /**
- * @Column(type="datetime")
- * @gedmo:Timestampable
- */
- private $updated;
-
- public function getCreated()
- {
- return $this->created;
- }
-
- public function getUpdated()
- {
- return $this->updated;
- }
-
- public function setParent($parent = null)
- {
- $this->parent = $parent;
- }
-
- public function getChildren()
- {
- return $this->children;
- }
-
- public function getParent()
- {
- return $this->parent;
- }
-
- public function getIdentifier()
- {
- return $this->identifier;
- }
- public function setIdentifier($identifier)
- {
- $this->identifier = $identifier;
- }
- }
|