|
1
|
|
|
<?php |
|
2
|
|
|
/* Copyright (C) 2018 Michael Giesler |
|
3
|
|
|
* |
|
4
|
|
|
* This file is part of Dembelo. |
|
5
|
|
|
* |
|
6
|
|
|
* Dembelo is free software: you can redistribute it and/or modify |
|
7
|
|
|
* it under the terms of the GNU Affero General Public License as published by |
|
8
|
|
|
* the Free Software Foundation, either version 3 of the License, or |
|
9
|
|
|
* (at your option) any later version. |
|
10
|
|
|
* |
|
11
|
|
|
* Dembelo is distributed in the hope that it will be useful, |
|
12
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14
|
|
|
* GNU Affero General Public License 3 for more details. |
|
15
|
|
|
* |
|
16
|
|
|
* You should have received a copy of the GNU Affero General Public License 3 |
|
17
|
|
|
* along with Dembelo. If not, see <http://www.gnu.org/licenses/>. |
|
18
|
|
|
*/ |
|
19
|
|
|
|
|
20
|
|
|
namespace DembeloMain\Document; |
|
21
|
|
|
|
|
22
|
|
|
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB; |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* Class TextnodeHitch |
|
26
|
|
|
* @MongoDB\Document(repositoryClass="\DembeloMain\Model\Repository\Doctrine\ODM\TextnodeHitchRepository") |
|
27
|
|
|
*/ |
|
28
|
|
|
class TextnodeHitch |
|
29
|
|
|
{ |
|
30
|
|
|
public const STATUS_INACTIVE = 0; |
|
31
|
|
|
public const STATUS_ACTIVE = 1; |
|
32
|
|
|
|
|
33
|
|
|
public const MAXIMUM_COUNT = 8; |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* @var string |
|
37
|
|
|
* |
|
38
|
|
|
* @MongoDB\Id |
|
39
|
|
|
*/ |
|
40
|
|
|
private $id; |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* @var string |
|
44
|
|
|
* |
|
45
|
|
|
* @MongoDB\Field(type="string") |
|
46
|
|
|
*/ |
|
47
|
|
|
private $description; |
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* @var Textnode |
|
51
|
|
|
* |
|
52
|
|
|
* @MongoDB\ReferenceOne(targetDocument="Textnode", inversedBy="childHitches") |
|
53
|
|
|
*/ |
|
54
|
|
|
private $sourceTextnode; |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* @var Textnode |
|
58
|
|
|
* |
|
59
|
|
|
* @MongoDB\ReferenceOne(targetDocument="Textnode", inversedBy="parentHitches") |
|
60
|
|
|
*/ |
|
61
|
|
|
private $targetTextnode; |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* @var int |
|
65
|
|
|
* |
|
66
|
|
|
* @MongoDB\Field(type="integer") |
|
67
|
|
|
*/ |
|
68
|
|
|
private $status; |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* @return string |
|
72
|
|
|
*/ |
|
73
|
1 |
|
public function getId(): ?string |
|
74
|
|
|
{ |
|
75
|
1 |
|
return $this->id; |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
/** |
|
79
|
|
|
* @param string $id |
|
80
|
|
|
* |
|
81
|
|
|
* @return void |
|
82
|
|
|
*/ |
|
83
|
1 |
|
public function setId(string $id): void |
|
84
|
|
|
{ |
|
85
|
1 |
|
$this->id = $id; |
|
86
|
1 |
|
} |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* @return string|null |
|
90
|
|
|
*/ |
|
91
|
5 |
|
public function getDescription(): ?string |
|
92
|
|
|
{ |
|
93
|
5 |
|
return $this->description; |
|
94
|
|
|
} |
|
95
|
|
|
|
|
96
|
|
|
/** |
|
97
|
|
|
* @param string $description |
|
98
|
|
|
*/ |
|
99
|
5 |
|
public function setDescription(string $description): void |
|
100
|
|
|
{ |
|
101
|
5 |
|
$this->description = $description; |
|
102
|
5 |
|
} |
|
103
|
|
|
|
|
104
|
|
|
/** |
|
105
|
|
|
* @return Textnode|null |
|
106
|
|
|
*/ |
|
107
|
5 |
|
public function getTargetTextnode(): ?Textnode |
|
108
|
|
|
{ |
|
109
|
5 |
|
return $this->targetTextnode; |
|
110
|
|
|
} |
|
111
|
|
|
|
|
112
|
|
|
/** |
|
113
|
|
|
* @param Textnode $targetTextnode |
|
114
|
|
|
*/ |
|
115
|
5 |
|
public function setTargetTextnode(Textnode $targetTextnode): void |
|
116
|
|
|
{ |
|
117
|
5 |
|
$this->targetTextnode = $targetTextnode; |
|
118
|
5 |
|
} |
|
119
|
|
|
|
|
120
|
|
|
/** |
|
121
|
|
|
* @return Textnode|null |
|
122
|
|
|
*/ |
|
123
|
1 |
|
public function getSourceTextnode(): ?Textnode |
|
124
|
|
|
{ |
|
125
|
1 |
|
return $this->sourceTextnode; |
|
126
|
|
|
} |
|
127
|
|
|
|
|
128
|
|
|
/** |
|
129
|
|
|
* @param Textnode $sourceTextnode |
|
130
|
|
|
*/ |
|
131
|
2 |
|
public function setSourceTextnode(Textnode $sourceTextnode): void |
|
132
|
|
|
{ |
|
133
|
2 |
|
$this->sourceTextnode = $sourceTextnode; |
|
134
|
2 |
|
} |
|
135
|
|
|
|
|
136
|
|
|
/** |
|
137
|
|
|
* @return int |
|
138
|
|
|
*/ |
|
139
|
4 |
|
public function getStatus(): int |
|
140
|
|
|
{ |
|
141
|
4 |
|
return $this->status; |
|
142
|
|
|
} |
|
143
|
|
|
|
|
144
|
|
|
/** |
|
145
|
|
|
* @param int $status |
|
146
|
|
|
*/ |
|
147
|
4 |
|
public function setStatus(int $status): void |
|
148
|
|
|
{ |
|
149
|
4 |
|
$this->status = $status; |
|
150
|
4 |
|
} |
|
151
|
|
|
} |
|
152
|
|
|
|