zend-blog-3-backend
92 строки · 1.4 Кб
1<?php
2
3namespace App\Entity\Embedded;
4
5use Doctrine\ORM\Mapping as ORM;
6
7/**
8* @ORM\Embeddable()
9*/
10class NestedSet
11{
12/**
13* @var int
14*
15* @ORM\Column(type="integer", nullable=true, options={"unsigned": true})
16*/
17private $leftKey;
18
19/**
20* @var int
21*
22* @ORM\Column(type="integer", nullable=true, options={"unsigned": true})
23*/
24private $rightKey;
25
26/**
27* @var int
28*
29* @ORM\Column(type="integer", options={"unsigned": true, "default": 1})
30*/
31private $depth = 1;
32
33/**
34* @return int
35*/
36public function getLeftKey(): int
37{
38return $this->leftKey;
39}
40
41/**
42* @param int $leftKey
43*
44* @return NestedSet
45*/
46public function setLeftKey(int $leftKey): self
47{
48$this->leftKey = $leftKey;
49
50return $this;
51}
52
53/**
54* @return int
55*/
56public function getRightKey(): int
57{
58return $this->rightKey;
59}
60
61/**
62* @param int $rightKey
63*
64* @return NestedSet
65*/
66public function setRightKey(int $rightKey): self
67{
68$this->rightKey = $rightKey;
69
70return $this;
71}
72
73/**
74* @return int
75*/
76public function getDepth(): int
77{
78return $this->depth;
79}
80
81/**
82* @param int $depth
83*
84* @return NestedSet
85*/
86public function setDepth(int $depth): self
87{
88$this->depth = $depth;
89
90return $this;
91}
92}
93