1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
4
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
5
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
6
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
7
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
8
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
9
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
10
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
11
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
12
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
13
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
14
|
|
|
* |
15
|
|
|
* This software consists of voluntary contributions made by many individuals |
16
|
|
|
* and is licensed under the MIT license. |
17
|
|
|
*/ |
18
|
|
|
namespace Elastification\Client\Response\V090x; |
19
|
|
|
|
20
|
|
|
use Elastification\Client\Response\Response; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Class DeleteDocumentResponse |
24
|
|
|
* |
25
|
|
|
* @package Elastification\Client\Response\V090x |
26
|
|
|
* @author Daniel Wendlandt |
27
|
|
|
*/ |
28
|
|
View Code Duplication |
class DeleteDocumentResponse extends Response |
|
|
|
|
29
|
|
|
{ |
30
|
|
|
|
31
|
|
|
const PROP_OK = 'ok'; |
32
|
|
|
const PROP_FOUND = 'found'; |
33
|
|
|
const PROP_ID = '_id'; |
34
|
|
|
const PROP_VERSION = '_version'; |
35
|
|
|
const PROP_INDEX = '_index'; |
36
|
|
|
const PROP_TYPE = '_type'; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* Getter Method |
40
|
|
|
* |
41
|
|
|
* @return mixed |
42
|
|
|
* @author Daniel Wendlandt |
43
|
|
|
*/ |
44
|
2 |
|
public function isOk() |
45
|
|
|
{ |
46
|
2 |
|
$this->processData(); |
47
|
|
|
|
48
|
2 |
|
return $this->get(self::PROP_OK); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* Getter Method |
53
|
|
|
* |
54
|
|
|
* @return mixed |
55
|
|
|
* @author Daniel Wendlandt |
56
|
|
|
*/ |
57
|
2 |
|
public function found() |
58
|
|
|
{ |
59
|
2 |
|
$this->processData(); |
60
|
|
|
|
61
|
2 |
|
return $this->get(self::PROP_FOUND); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* Getter Method |
66
|
|
|
* |
67
|
|
|
* @return mixed |
68
|
|
|
* @author Daniel Wendlandt |
69
|
|
|
*/ |
70
|
2 |
|
public function getId() |
71
|
|
|
{ |
72
|
2 |
|
$this->processData(); |
73
|
|
|
|
74
|
2 |
|
return $this->get(self::PROP_ID); |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* Getter Method |
79
|
|
|
* |
80
|
|
|
* @return mixed |
81
|
|
|
* @author Daniel Wendlandt |
82
|
|
|
*/ |
83
|
2 |
|
public function getVersion() |
84
|
|
|
{ |
85
|
2 |
|
$this->processData(); |
86
|
|
|
|
87
|
2 |
|
return $this->get(self::PROP_VERSION); |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* Getter Method |
92
|
|
|
* |
93
|
|
|
* @return mixed |
94
|
|
|
* @author Daniel Wendlandt |
95
|
|
|
*/ |
96
|
2 |
|
public function getIndex() |
97
|
|
|
{ |
98
|
2 |
|
$this->processData(); |
99
|
|
|
|
100
|
2 |
|
return $this->get(self::PROP_INDEX); |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* Getter Method |
105
|
|
|
* |
106
|
|
|
* @return mixed |
107
|
|
|
* @author Daniel Wendlandt |
108
|
|
|
*/ |
109
|
12 |
|
public function getType() |
110
|
|
|
{ |
111
|
2 |
|
$this->processData(); |
112
|
|
|
|
113
|
12 |
|
return $this->get(self::PROP_TYPE); |
114
|
|
|
} |
115
|
|
|
} |
116
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.