File tree Expand file tree Collapse file tree 3 files changed +13
-14
lines changed Expand file tree Collapse file tree 3 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public function __construct(SimpleXMLElement $xml)
48
48
*/
49
49
public function getXml ()
50
50
{
51
- return $ this ->getXml () ;
51
+ return $ this ->xml ;
52
52
}
53
53
54
54
/**
Original file line number Diff line number Diff line change @@ -146,7 +146,9 @@ public function updateBatch(BatchRequest $batchRequest)
146
146
public function insertBatch (BatchRequest $ batchRequest )
147
147
{
148
148
$ xml = $ batchRequest ->createRequestXml ($ this );
149
- $ response = ServiceRequestFactory::getInstance ()->post ($ this ->getBatchUrl (), $ xml , array ("If-Match: * " ));
149
+ $ response = ServiceRequestFactory::getInstance ()
150
+ ->setHeaders (array ("If-Match " => "* " ))
151
+ ->post ($ this ->getBatchUrl (), $ xml );
150
152
return new BatchResponse (new SimpleXMLElement ($ response ));
151
153
}
152
154
@@ -172,12 +174,14 @@ public function getBatchUrl()
172
174
/**
173
175
* Create a entry to insert data
174
176
*
175
- * @param int $row
176
- * @param int $col
177
+ * @param int $row
178
+ * @param int $col
177
179
* @param string $content
180
+ *
178
181
* @return CellEntry
179
182
*/
180
- public function createInsertionCell ($ row , $ col , $ content ) {
183
+ public function createInsertionCell ($ row , $ col , $ content )
184
+ {
181
185
$ xml = new SimpleXMLElement ('<entry></entry> ' );
182
186
$ child = $ xml ->addChild ('content ' , $ content );
183
187
$ child ->addAttribute ('type ' , 'text ' );
Original file line number Diff line number Diff line change @@ -135,18 +135,13 @@ public function get($url)
135
135
* Perform a post request
136
136
*
137
137
* @param string $url
138
- * @param mixed $postData
139
- * @param array $extraHeaders
138
+ * @param mixed $postData
139
+ *
140
140
* @return string
141
141
*/
142
- public function post ($ url , $ postData, $ extraHeaders = array () )
142
+ public function post ($ url , $ postData )
143
143
{
144
- $ headers = array_merge (
145
- array ('Content-Type: application/atom+xml ' ),
146
- $ extraHeaders
147
- );
148
-
149
- $ ch = $ this ->initRequest ($ url , $ headers );
144
+ $ ch = $ this ->initRequest ($ url , array ('Content-Type: application/atom+xml ' ));
150
145
curl_setopt ($ ch , CURLOPT_CUSTOMREQUEST , 'POST ' );
151
146
curl_setopt ($ ch , CURLOPT_POSTFIELDS , $ postData );
152
147
return $ this ->execute ($ ch );
You can’t perform that action at this time.
0 commit comments