|
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\V2x; |
|
19
|
|
|
|
|
20
|
|
|
use Elastification\Client\Response\Response; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* @package Elastification\Client\Response\V2x |
|
24
|
|
|
* @author Daniel Wendlandt |
|
25
|
|
|
*/ |
|
26
|
|
|
class CreateUpdateDocumentResponse extends Response |
|
27
|
|
|
{ |
|
28
|
|
|
|
|
29
|
|
|
const PROP_CREATED = 'created'; |
|
30
|
|
|
const PROP_ID = '_id'; |
|
31
|
|
|
const PROP_VERSION = '_version'; |
|
32
|
|
|
const PROP_INDEX = '_index'; |
|
33
|
|
|
const PROP_TYPE = '_type'; |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* @return boolean |
|
37
|
|
|
* @author Mario Mueller |
|
38
|
|
|
*/ |
|
39
|
2 |
|
public function created() |
|
40
|
|
|
{ |
|
41
|
2 |
|
$this->processData(); |
|
42
|
|
|
|
|
43
|
2 |
|
return $this->get(self::PROP_CREATED); |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @return string |
|
48
|
|
|
* @author Mario Mueller |
|
49
|
|
|
*/ |
|
50
|
2 |
|
public function getId() |
|
51
|
|
|
{ |
|
52
|
2 |
|
$this->processData(); |
|
53
|
|
|
|
|
54
|
2 |
|
return $this->get(self::PROP_ID); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* @return integer |
|
59
|
|
|
* @author Mario Mueller |
|
60
|
|
|
*/ |
|
61
|
2 |
|
public function getVersion() |
|
62
|
|
|
{ |
|
63
|
2 |
|
$this->processData(); |
|
64
|
|
|
|
|
65
|
2 |
|
return $this->get(self::PROP_VERSION); |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* @return string |
|
70
|
|
|
* @author Mario Mueller |
|
71
|
|
|
*/ |
|
72
|
2 |
|
public function getIndex() |
|
73
|
|
|
{ |
|
74
|
2 |
|
$this->processData(); |
|
75
|
|
|
|
|
76
|
2 |
|
return $this->get(self::PROP_INDEX); |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
/** |
|
80
|
|
|
* @return string |
|
81
|
|
|
* @author Mario Mueller |
|
82
|
|
|
*/ |
|
83
|
2 |
|
public function getType() |
|
84
|
|
|
{ |
|
85
|
2 |
|
$this->processData(); |
|
86
|
|
|
|
|
87
|
2 |
|
return $this->get(self::PROP_TYPE); |
|
88
|
|
|
} |
|
89
|
|
|
} |
|
90
|
|
|
|