12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
-
- namespace Tree\Fixture;
-
- use Gedmo\Mapping\Annotation as Gedmo;
- use Doctrine\ORM\Mapping as ORM;
-
- /**
- * @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\NestedTreeRepository")
- * @ORM\InheritanceType("SINGLE_TABLE")
- * @ORM\DiscriminatorColumn(name="discriminator", type="string")
- * @ORM\DiscriminatorMap({"base" = "BaseNode", "node" = "Node"})
- * @Gedmo\Tree(type="nested")
- */
- class BaseNode extends ANode
- {
- /**
- * @Gedmo\TreeParent
- * @ORM\ManyToOne(targetEntity="BaseNode", inversedBy="children")
- * @ORM\JoinColumns({
- * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="SET NULL")
- * })
- */
- private $parent;
-
- /**
- * @ORM\OneToMany(targetEntity="BaseNode", mappedBy="parent")
- */
- private $children;
-
- /**
- * @Gedmo\Timestampable(on="create")
- * @ORM\Column(type="datetime")
- */
- private $created;
-
- /**
- * @ORM\Column(length=128, unique=true)
- */
- private $identifier;
-
- /**
- * @ORM\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;
- }
- }
|