1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace SalesforceBulkApi\dto; |
4
|
|
|
|
5
|
|
|
use BaseHelpers\hydrators\ConstructFromArrayOrJson; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* For more info follow the link |
9
|
|
|
* https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_reference_jobinfo.htm |
10
|
|
|
*/ |
11
|
|
|
class CreateJobDto extends ConstructFromArrayOrJson |
12
|
|
|
{ |
13
|
|
|
const CONTENT_TYPE_JSON = 'JSON'; |
14
|
|
|
const CONTENT_TYPE_CSV = 'CSV'; |
15
|
|
|
const CONTENT_TYPE_XML = 'XML'; |
16
|
|
|
const CONTENT_TYPE_ZIP_CSV = 'ZIP_CSV'; |
17
|
|
|
const CONTENT_TYPE_ZIP_JSON = 'ZIP_JSON'; |
18
|
|
|
const CONTENT_TYPE_ZIP_XML = 'ZIP_XML'; |
19
|
|
|
|
20
|
|
|
const OPERATION_INSERT = 'insert'; |
21
|
|
|
const OPERATION_DELETE = 'delete'; |
22
|
|
|
const OPERATION_QUERY = 'query'; |
23
|
|
|
const OPERATION_QUERY_ALL = 'queryall'; |
24
|
|
|
const OPERATION_UPSERT = 'upsert'; |
25
|
|
|
const OPERATION_UPDATE = 'update'; |
26
|
|
|
const OPERATION_HARD_DELETE = 'hardDelete'; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var string |
30
|
|
|
*/ |
31
|
|
|
protected $operation = self::OPERATION_INSERT; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var string |
35
|
|
|
*/ |
36
|
|
|
protected $object; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var string |
40
|
|
|
*/ |
41
|
|
|
protected $externalIdFieldName; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var string |
45
|
|
|
*/ |
46
|
|
|
protected $contentType = self::CONTENT_TYPE_JSON; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @return string |
50
|
|
|
*/ |
51
|
|
|
public function getOperation() |
52
|
|
|
{ |
53
|
|
|
return $this->operation; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @param string $operation |
58
|
|
|
* |
59
|
|
|
* @return $this |
60
|
|
|
*/ |
61
|
|
|
public function setOperation($operation) |
62
|
|
|
{ |
63
|
|
|
$this->operation = $operation; |
64
|
|
|
return $this; |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @return string |
69
|
|
|
*/ |
70
|
|
|
public function getObject() |
71
|
|
|
{ |
72
|
|
|
return $this->object; |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* @param string $object |
77
|
|
|
* |
78
|
|
|
* @return $this |
79
|
|
|
*/ |
80
|
|
|
public function setObject($object) |
81
|
|
|
{ |
82
|
|
|
$this->object = $object; |
83
|
|
|
return $this; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @return string |
88
|
|
|
*/ |
89
|
|
|
public function getContentType() |
90
|
|
|
{ |
91
|
|
|
return $this->contentType; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @param string $contentType |
96
|
|
|
* |
97
|
|
|
* @return $this |
98
|
|
|
*/ |
99
|
|
|
public function setContentType($contentType) |
100
|
|
|
{ |
101
|
|
|
$this->contentType = $contentType; |
102
|
|
|
return $this; |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* @return string |
107
|
|
|
*/ |
108
|
|
|
public function getExternalIdFieldName() |
109
|
|
|
{ |
110
|
|
|
return $this->externalIdFieldName; |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* @param string $externalIdFieldName |
115
|
|
|
* |
116
|
|
|
* @return $this |
117
|
|
|
*/ |
118
|
|
|
public function setExternalIdFieldName($externalIdFieldName) |
119
|
|
|
{ |
120
|
|
|
$this->externalIdFieldName = $externalIdFieldName; |
121
|
|
|
return $this; |
122
|
|
|
} |
123
|
|
|
} |