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
|
|
|
public function created() |
40
|
|
|
{ |
41
|
|
|
$this->processData(); |
42
|
|
|
|
43
|
|
|
return $this->get(self::PROP_CREATED); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @return string |
48
|
|
|
* @author Mario Mueller |
49
|
|
|
*/ |
50
|
|
|
public function getId() |
51
|
|
|
{ |
52
|
|
|
$this->processData(); |
53
|
|
|
|
54
|
|
|
return $this->get(self::PROP_ID); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @return integer |
59
|
|
|
* @author Mario Mueller |
60
|
|
|
*/ |
61
|
|
|
public function getVersion() |
62
|
|
|
{ |
63
|
|
|
$this->processData(); |
64
|
|
|
|
65
|
|
|
return $this->get(self::PROP_VERSION); |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @return string |
70
|
|
|
* @author Mario Mueller |
71
|
|
|
*/ |
72
|
|
|
public function getIndex() |
73
|
|
|
{ |
74
|
|
|
$this->processData(); |
75
|
|
|
|
76
|
|
|
return $this->get(self::PROP_INDEX); |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @return string |
81
|
|
|
* @author Mario Mueller |
82
|
|
|
*/ |
83
|
|
|
public function getType() |
84
|
|
|
{ |
85
|
|
|
$this->processData(); |
86
|
|
|
|
87
|
|
|
return $this->get(self::PROP_TYPE); |
88
|
|
|
} |
89
|
|
|
} |
90
|
|
|
|