| @@ 177-188 (lines=12) @@ | ||
| 174 | * |
|
| 175 | * @throws SalesforceException |
|
| 176 | */ |
|
| 177 | public function create(array $params) |
|
| 178 | { |
|
| 179 | $response = $this->sendRequest('POST', "/sobjects/" . $this->getType(), [ |
|
| 180 | 'json' => $params, |
|
| 181 | ]); |
|
| 182 | ||
| 183 | if ($response->success !== true) { |
|
| 184 | throw new SalesforceException($response->errors); |
|
| 185 | } |
|
| 186 | ||
| 187 | return $response; |
|
| 188 | } |
|
| 189 | ||
| 190 | /** |
|
| 191 | * Delete a given record |
|
| @@ 196-205 (lines=10) @@ | ||
| 193 | * @param string $id |
|
| 194 | * @throws SalesforceException |
|
| 195 | */ |
|
| 196 | public function delete(string $id) |
|
| 197 | { |
|
| 198 | $response = $this->sendRequest('DELETE', "/sobjects/" . $this->getType() . "/$id"); |
|
| 199 | ||
| 200 | if ($response->success !== true) { |
|
| 201 | throw new SalesforceException($response->errors); |
|
| 202 | } |
|
| 203 | ||
| 204 | return $response; |
|
| 205 | } |
|
| 206 | ||
| 207 | public function report(string $id, bool $includeDetails = true) |
|
| 208 | { |
|